Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Translator documentation

Translation files (.po)

Comments - #

All lines in the translation files that start with # are comments, either aimed at helping developers or helping translators.

...

Code Block
languagebash
titleEscaping of double quotes example
#: .submission.workflow.generic.delete-help
msgid ""
"If you would to discard this item, select \"Delete\".  You will then be "
"asked to confirm it."
msgstr ""
"If you would to discard this item, select \"Delete\".  You will then be "
"asked to confirm it."

Message Context - msgctxt

Apart from comments, starting with #, the msgid lines representing the key, and the msgstr lines, representing the translations, an entry can also contain a msgctxt line.

Originally, in linux gettext, they are being used to disambiguate messages. Let's say you have two different places in the application where you are using "Person" in English, you sometimes need the ability to give both of these occurences a different translation in another language. 

This is why uniqueness is actually not enforced on the uniqueness of the msgid, but on the uniqueness of the combination between msgid, and another directive, msgctxt.

Here's an example, outside of DSpace, showing that "Normal" requires different grammar in another language, depending on the context in which it is used.

Code Block
languagebash
titleGeneral gettext / PO example of msgctxt
#: utils/katestyletreewidget.cpp:132
msgctxt "Text style"
msgid "Normal"
msgstr "običan"
⁠
#: utils/kateautoindent.cpp:78
msgctxt "Autoindent mode"
msgid "Normal"
msgstr "obično"


Dynamic key example


The Angular DSpace 7 message catalog (dspace.pot)

...