Weblate translations for Android app

Looks like a bug in Weblate’s format handling for the Android string resources. I’ve reported it to Weblate’s support tracker. Let’s see what happens.

Note that even back on Transifex, our translation files had a mixture of properly escaped and bare question marks, and it seems to have “worked” for the Android app. So fortunately, the app’s XML parser seems to be lenient in that regard.

1 Like

Seems like Weblate’s behavior is correct, while the official Android documentation is slightly inaccurate:

Hello André,

Question marks need to be escaped only if used as the first character in the string to avoid interpreting them as style references. Escaping all question marks doesn’t harm, but is not needed. Weblate has recently changed to escape question marks only at the beginning of the string for improved readability of the files, see Reduce question mark escaping in Android · Issue #5064 · translate/translate · GitHub.

I will also add a note to Android string resources - Weblate 5.2 documentation about this shortly.

Best regards,

Michal Čihař


I will refrain from unescaping back all now escaped question marks in bulk though. Let’s just watch as translations come in and stuff gets corrected automatically. Either way works, so we don’t need to take action.

Just a heads up, I have locked the app string translations currently. Was hoping to get i18n: Indirect string-array declarations through arrays.xml by acolomb · Pull Request #2012 · syncthing/syncthing-android · GitHub merged rather quickly, without getting new conflicts because of incoming Weblate translation changes. However I’m still waiting for a review approval there.

The background is that Weblate doesn’t support “string-array” elements in the Android XML resource files, therefore all these strings are currently missing on the platform.