Closed stevenb9 closed 5 years ago
This was a decision made by @keverets in 5c63f8d1c17d5296d5e3f5123f44b8effa732ca4
Add Gettext formatter to read and write to .po files
This uses the same style as android2po where msgctxt is used as the
key, msgid is the original string in the default language, and msgstr
is the translated version in the destination language.
Does this not seem right to you? Digging through some of the gettext documentation does not make the correct solution seem obvious.
Also, this is all somewhat related to #201
For a while if you didn't specify format
explicitly, then an undefined one was used for po
files (either Django or gettext). I notice that your consume-all-localization-files
command above did not specify gettext
, so it's possible that it tried to consume them using the django
formatter.
Closing due to inactivity. Unclear whether or not there is actually a bug here.
I' m currently using twine 0.10.1 and when exporting iOS translations to PO files, the exported PO files seem to use the string for id. When importing the translated files twine will warn "Warning: 'Terms & Conditions' not found in twine file." for each entry and no translated strings gets updated in the twine data file.
I created my twine datafile using this command: twine consume-all-localization-files twine.txt /Localization --developer-language en --consume-all --consume-comments
Then I exported PO files for localization: twine generate-localization-file twine.txt en.po --lang en --format gettext or twine generate-localization-archive twine.txt LocDrop1.zip --format gettext
The content of my PO file: msgctxt "initial_masterpinTitle" msgid "Create a master pincode" msgstr "Create a master pincode"
msgctxt "initial_masterpinHelp" msgid "This pincode is required to view \n age-rated content" msgstr "This pincode is required to view \n age-rated content"
msgctxt "initial_masterpinReEnter" msgid "initial_masterpinReEnter" msgstr "Re-enter master pincode"
Expected: msgctxt "initial_masterpinTitle" msgid "initial_masterpinTitle" msgstr "Create a master pincode"
msgctxt "initial_masterpinHelp" msgid "initial_masterpinHelp" msgstr "This pincode is required to view \n age-rated content"
msgctxt "initial_masterpinReEnter" msgid "initial_masterpinReEnter" msgstr "Re-enter master pincode"
When importing, the keys from the po file don't match the existing keys in the twine.txt datafile. This seems to work when exporting as apple .strings