Hi all,
I think I've found an issue with the generation of Android localization files, using Twine 1.0.4, and having an entry in the twine file like this:
[[ContextSensitiveHelp]]
[contextSensitiveHelp_home_bottomMenuBar_message]
en = The most used sections can be accessed here. Tapping "More" reveals a list with all other sections.
comment = Help item message about the usage of the bottom menu bar.
de = The most used sections can be accessed here. Tapping "More" reveals a list with all other sections.
causes some issues when exporting to PO files, using the following command
twine generate-localization-file twine.txt translations_20_02_19_en.po --lang en --format gettext :
#. "Help item message about the usage of the bottom menu bar."
msgctxt "contextSensitiveHelp_home_bottomMenuBar_message"
msgid "The most used sections can be accessed here. Tapping "More" reveals a list with all other sections."
msgstr "The most used sections can be accessed here. Tapping "More" reveals a list with all other sections."
You can see that the "More" isn't correctly escaped. Generating localization files with this however works fine.
The quick idea to fix this was escaping the " within the twine file:
[[ContextSensitiveHelp]]
[contextSensitiveHelp_home_bottomMenuBar_message]
en = The most used sections can be accessed here. Tapping \"More\" reveals a list with all other sections.
comment = Help item message about the usage of the bottom menu bar.
de = The most used sections can be accessed here. Tapping \"More\" reveals a list with all other sections.
Which leads to a correct PO file entry:
#. "Help item message about the usage of the bottom menu bar."
msgctxt "contextSensitiveHelp_home_bottomMenuBar_message"
msgid "The most used sections can be accessed here. Tapping \"More\" reveals a list with all other sections."
msgstr "The most used sections can be accessed here. Tapping \"More\" reveals a list with all other sections."
but then the Android localization files are affected using
twine generate-localization-file twine.txt ../app/src/skinFlavour/res/values/strings_generated.xml --lang en --format android:
<!-- Help item message about the usage of the bottom menu bar. -->
<string name="contextSensitiveHelp_home_bottomMenuBar_message">The most used sections can be accessed here. Tapping \\"More\\" reveals a list with all other sections.</string>
The expected output would be that the PO file would have been generated properly with the " part of the string being escaped like above:
#. "Help item message about the usage of the bottom menu bar."
msgctxt "contextSensitiveHelp_home_bottomMenuBar_message"
msgid "The most used sections can be accessed here. Tapping \"More\" reveals a list with all other sections."
msgstr "The most used sections can be accessed here. Tapping \"More\" reveals a list with all other sections."
Hi all, I think I've found an issue with the generation of Android localization files, using Twine 1.0.4, and having an entry in the twine file like this:
causes some issues when exporting to PO files, using the following command twine generate-localization-file twine.txt translations_20_02_19_en.po --lang en --format gettext :
You can see that the "More" isn't correctly escaped. Generating localization files with this however works fine.
The quick idea to fix this was escaping the " within the twine file:
Which leads to a correct PO file entry:
but then the Android localization files are affected using twine generate-localization-file twine.txt ../app/src/skinFlavour/res/values/strings_generated.xml --lang en --format android:
The expected output would be that the PO file would have been generated properly with the " part of the string being escaped like above:
Kind regards, Davy