Use gettext's contexts and extracted comments instead of our pipe syntax
|Reported by:||nbachiyski||Owned by:||nbachiyski|
Our current (#3687) functionality for disambiguating and adding descriptions to translated strings has some flaws:
- We are using the same syntax (the pipe) for both disambiguating and adding descriptions
- It screws translation memories, because Approved|main page and Approved|adjective are different strings for them
- Translations get confused and often don't get that the text after | is a description or context
Instead, the recent gettext versions provide the following functionality:
- Contexts, which are part of the PO syntax:
msgctxt "context" msgid "term" msgstr "translation"
xgettext supports it and most translation tools too. poEdit works correctly with them, but still doesn't show the context anywhere.
- Extracted comments. If there is a comment directly preceding the gettext call, starting with, let's say translators, it is inserted as a comment in the PO file.
/* translators, see http://php.net/date */ $date = date(__('d.m.Y'));
#. translators, see http://php.net/date msgid "d.m.Y" msgstr ""
These comments are shown by all translation software.