WeblateOrg / weblate

Web based localization tool with tight version control integration.
https://weblate.org/
GNU General Public License v3.0
4.56k stars 1.01k forks source link

Having \? in aresource file for Android project #9570

Closed razor313 closed 1 year ago

razor313 commented 1 year ago

Describe the issue

Once we receive/download all translations in the Android project there's \ along with a question mark like this {MY_TEXT}\? But in the Weblate console, we don't have it! {MY_TEXT}?

I guess it has to do with this commit.

Also, I've read this thread but didn't help me.

I already tried

Steps to reproduce the behavior

Define a new translation with ? Go to the file and download it, you will see it like \?

Expected behavior

No response

Screenshots

No response

Exception traceback

No response

How do you run Weblate?

Docker container

Weblate versions

No response

Weblate deploy checks

No response

Additional context

No response

nijel commented 1 year ago

That's correct, the ? should escaped in the file, see https://developer.android.com/guide/topics/resources/string-resource#escaping_quotes

github-actions[bot] commented 1 year ago

This issue has been marked as a question by a Weblate team member. Why? Because it belongs more to the professional Weblate Care or community Discussions than here. We strive to answer these reasonably fast here, too, but purchasing the support subscription is more responsible and faster for your business. And it makes Weblate stronger as well. Thanks!

In case your question is already answered, making a donation is the right way to say thank you!

Saroni11 commented 1 year ago

This issue has been marked as a question by a Weblate team member. Why? Because it belongs more to the professional Weblate Care or community Discussions than here. We strive to answer these reasonably fast here, too, but purchasing the support subscription is more responsible and faster for your business. And it makes Weblate stronger as well. Thanks!

In case your question is already answered, making a donation is the right way to say thank you!

razor313 commented 1 year ago

@nijel Yes, that's right! Thank you for sharing. 🙏

github-actions[bot] commented 1 year ago

The issue you have reported is now resolved. If you don’t feel it’s right, please follow its labels to get a clue for further steps.

tipa commented 11 months ago

I just noticed those escaped question marks in my downloads as well and was about to create an issue when I found this one.

I had special characters in my XMLs for years (@, ?, chinese characters) without issues. Only characters that need escaping are ' " < > &. When creating a new string resource in Android Studio, it does escape those, but no other characters - @, ? or chinese characters are not escaped.

So I am surprised about that linked documentation. And if Weblate aims to follow that documentation, wouldn't Chinese characters also have to be escaped? Because currently they aren't.

Also, the Android docs say you must escape the characters according to the standard XML/HTML escaping rules. However, whatever resource I pull up in the web, it only lists the 5 special characters I mentioned above: https://www.liquid-technologies.com/Reference/Glossary/XML_EscapingData.html https://stackoverflow.com/questions/1091945 https://docs.oracle.com/cd/A97335_02/apps.102/bc4j/developing_bc_projects/obcCustomXml.htm

So I don't know what "standard" Google is referring to here, but the entire internet seems to follow a different standard (as well as Android Studio - their own product).

I would appreciate if this bug report / change request could be reconsidered.

nijel commented 11 months ago

Okay, I did the research here and the escaping is needed. But it is only needed if the question mark is at the beginning of the string, see https://github.com/translate/translate/issues/5064 for more info.