Last modified: 2013-03-07 12:38:48 UTC
Steps to reproduce: 1. Import a PO file with for example the following messages (that are in KDE's kdelibs/solid_qt file): msgid "%1 TiB" msgstr "%1 TiB" msgid "%1 TiB" msgctxt "" msgstr "%1 TiB" 2. Export it Actual results: In the exported file it becomes like this: msgid "%1 TiB" msgstr "%1 TiB" msgid "%1 TiB" msgstr "%1 TiB" And then gettext gives errors about duplicate definitions of the same message. Expected results: The empty msgctxt is preserved and export it's differentiated from the message not having a msgctxt.
You need to provide a little extra information. Steps to reproduce and gettext file headers with at least a few keys need to be known. Translate is fully dependent on the value of msgctxt for it's offline file format, which has nothing to do with the final gettext format. msgctxt stores the key that allows Translate match a translation to an internal key. The final gettext files can only be exported using the export.php script, and the source files from version control cannot be imported through Special:ImportTranslations. See https://www.mediawiki.org/wiki/Help:Extension:Translate/Off-line_translation for offline translation documentation.
This is not about off-line translation.
OK, so with import I meant configuring a message group for the source files and then processing the changes and importing the existing translations. I followed steps described at http://www.mediawiki.org/wiki/Help:Extension:Translate/Group_configuration and http://www.mediawiki.org/wiki/Help:Extension:Translate/Group_management An example PO file with its corresponding POT file is attached. With export I meant using the "Export in native format" option on the export page of the message group (visualized as the Export tab). Or using export.php.
Created attachment 11643 [details] Example PO file
Created attachment 11644 [details] Example POT file
https://gerrit.wikimedia.org/r/52613