Last modified: 2013-03-07 12:38:48 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T45953, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 43953 - Empty (but existing) msgctxt isn't handled correctly in PO file export
Empty (but existing) msgctxt isn't handled correctly in PO file export
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Translate (Other open bugs)
master
All All
: Normal normal (vote)
: ---
Assigned To: Niklas Laxström
: need-unittest
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-01-14 07:22 UTC by Lasse Liehu
Modified: 2013-03-07 12:38 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Example PO file (707 bytes, text/plain)
2013-01-17 08:57 UTC, Lasse Liehu
Details
Example POT file (597 bytes, text/plain)
2013-01-17 08:57 UTC, Lasse Liehu
Details

Description Lasse Liehu 2013-01-14 07:22:43 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.
Comment 1 Siebrand Mazeland 2013-01-14 07:59:53 UTC
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.
Comment 2 Niklas Laxström 2013-01-14 08:20:31 UTC
This is not about off-line translation.
Comment 3 Lasse Liehu 2013-01-17 08:56:59 UTC
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.
Comment 4 Lasse Liehu 2013-01-17 08:57:23 UTC
Created attachment 11643 [details]
Example PO file
Comment 5 Lasse Liehu 2013-01-17 08:57:38 UTC
Created attachment 11644 [details]
Example POT file
Comment 6 Niklas Laxström 2013-03-07 12:29:45 UTC
https://gerrit.wikimedia.org/r/52613

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links