If I start with django.po file containing entries like:
#: path/to/file.py:209
#, python-format
msgid "Look what I just bought on %(app_name)s "
msgstr "Guarda un po' che cosa ho appena comperato su %(app_name)s. "
twine consume-all-localization-files imports this as:
[Look what I just bought on %(app_name)s ]
it = `Guarda un po' che cosa ho appena comperato su %(app_name)s. `
Twine docs say:
Twine supports printf style placeholders with one peculiarity: @ is used for strings instead of s.
...so I don't think this is valid.
And outputs to Android as:
<string name="Look what I just bought on %(app_name)s ">Guarda un po\' che cosa ho appena comperato su %(app_name)s.\u0020</string>
and iOS as:
"Look what I just bought on %(app_name)s " = "Guarda un po' che cosa ho appena comperato su %(app_name)s. ";
Reading more in the Android and Apple docs it seems like they only support index-based string formatting(?). This will make it harder to convert django .po files which routinely contain python-format and python-brace-format (ie values substituted by named arg via dictionary/hashmap) as supported by gettext.
If it's not possible the consume-all-localization-files script should warn that the result will be invalid and needs hand-editing, or just bail out.
If I start with
django.po
file containing entries like:twine consume-all-localization-files
imports this as:Twine docs say:
...so I don't think this is valid.
And outputs to Android as:
and iOS as:
I am pretty sure that neither iOS nor Android supports
%(app_name)s
as a string substitution format, so these are invalid. https://developer.android.com/reference/java/util/Formatter.html https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/Strings/Articles/FormatStrings.html#//apple_ref/doc/uid/20000943Reading more in the Android and Apple docs it seems like they only support index-based string formatting(?). This will make it harder to convert django .po files which routinely contain
python-format
andpython-brace-format
(ie values substituted by named arg via dictionary/hashmap) as supported by gettext.If it's not possible the
consume-all-localization-files
script should warn that the result will be invalid and needs hand-editing, or just bail out.