Skip to content

Commit 19598ac

Browse files
committed
doc: link to pology; document use of .Hint extracted comments
1 parent 461ee46 commit 19598ac

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

doc/developers.txt

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,8 @@ How stuff works:
289289
Interface uses language selected by currently authenticated user.
290290

291291
Additional details may be found in `GNU gettext`_ and Python `gettext
292-
module`_ documentation.
292+
module`_ documentation. Additional information on ``.po`` translation
293+
files can also be found at pology_.
293294

294295
`Roundup source distribution`_ includes POT and PO files for message
295296
translators, and also pre-built MO files to facilitate installations
@@ -343,6 +344,29 @@ script) has no human readable parts at all, and needs no translations.
343344
Such strings are left untranslated in PO files, and are reported
344345
as such by PO status checkers (e.g. ``msgfmt --statistics``).
345346

347+
Hints for the translator can be added by adding a comment block
348+
starting with ``# .Hint``. The hints will be extracted into the .pot
349+
file and merged to the .po files used by the translators. This can add
350+
context to how the string is used. For example from admin.py::
351+
352+
# .Hint read as: assignedto was admin(1)
353+
# where assignedto is the property
354+
# admin is the key name for value 1
355+
_("%(prop)s was %(name)s(%(value)s)")
356+
357+
is shown in the .po file as::
358+
359+
#. .Hint read as: assignedto was admin(1)
360+
#. where assignedto is the property
361+
#. admin is the key name for value 1
362+
#: ../roundup/admin.py:1091
363+
#, python-format
364+
msgid "%(prop)s was %(name)s(%(value)s)"
365+
msgstr ""
366+
367+
allowing the translator to see the replaced string so they can
368+
understand how name and value are used.
369+
346370
Command Line Interfaces
347371
~~~~~~~~~~~~~~~~~~~~~~~
348372

@@ -559,6 +583,8 @@ tools that may help you with this process:
559583
informed the original plugin author about these changes, but got
560584
no reply so far.
561585

586+
Additional information on ``.po`` files can be found at pology_.
587+
562588
Compiling Message Catalogs
563589
^^^^^^^^^^^^^^^^^^^^^^^^^^
564590

@@ -621,6 +647,7 @@ At run time, Roundup automatically compiles message catalogs whenever
621647
https://vim.sourceforge.io/scripts/script.php?script_id=695
622648
.. _PO utilities: https://github.com/pinard/po-utils
623649
.. _poEdit: https://poedit.net/
650+
.. _pology: http://pology.nedohodnik.net/doc/user/en_US/ch-poformat.html
624651
.. _pylint: https://pylint.pycqa.org/en/latest/
625652
.. _Roundup Source:
626653
.. _Roundup source distribution:

0 commit comments

Comments
 (0)