android-l10n should escape straight apostrophes or double quotes when user submits a translation
Categories
(Webtools Graveyard :: Pontoon, defect, P2)
Tracking
(Not tracked)
People
(Reporter: ajtzibsyani, Unassigned)
References
Details
Attachments
(1 file)
120.35 KB,
image/png
|
Details |
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:74.0) Gecko/20100101 Firefox/74.0
Steps to reproduce:
I wanted to locate the Android L10n project in kaqchikel
Actual results:
Strings containing words that are written with apostrophe do not allow you to save them instead this message appears "Apostrophe must be escaped"
Expected results:
The other projects that are located in kaqchikel can be used apostrophe.
Comment 1•5 years ago
|
||
Hi Juan!
You can still use apostrophes, they just need to be "escaped". This is an issue with the Android build system. It's very delicate and introducing unescaped characters break things.
To escape a character, all you need to do is introduce a \ character before it. I've submitted a suggestion for that string from translation memory that includes the escaped characters in the appropriate spots: https://pontoon.mozilla.org/cak/android-l10n/mozilla-mobile/android-components/components/browser/engine-system/src/main/res/values/strings.xml/?string=198458
Hope this helps. Please feel free to reopen this if you feel you need more help or more answers.
Jeff
Comment 2•5 years ago
•
|
||
In Firefox for Android you normally don't have to escape apostrophes, that's taken care of by Pontoon.
Is that assumption still valid for android-l10n and XML files?
If that's the case, I assume the problem here is the fact that the string has both " and '. Can Pontoon be smart and solve the problem transparently?
Reporter | ||
Comment 3•5 years ago
|
||
I do not know what the problem is, but although there is not (") I always receive the message" The following verifications have failed = The apostrophe must escape "
Comment 4•5 years ago
|
||
I tried, and indeed I can't submit a translation including '
. I don't think that's reasonable to ask localizers to escape characters in their translation?
I've double checked, and Firefox for Android would allow me to add those characters, and escape them silently. I think that should happen also for android-l10n.
Updated•5 years ago
|
Comment 5•5 years ago
|
||
One solution is to change the parser, serializer and checks to handle escaping and unescaping of quotes behind the scenes, similar to how we handle it in DTDs. Resources:
- bug 1193860
- bug 1390111
- https://github.com/mozilla/pontoon/blob/master/pontoon/sync/formats/silme.py#L90
- https://github.com/mozilla/pontoon/blob/master/pontoon/sync/utils.py#L134
The other solution is to implement editor hooks and automatically escape quotes as they are entered into the editor. That would also require work on TM to make sure strings are reusable across projects.
In any of the solutions we should migrate manually escaped translations and their TM entries.
Comment 6•5 years ago
|
||
I was wondering about what we want to do with Android mid-term. Looking at https://developer.android.com/guide/topics/resources/string-resource, escaping is just one thing that's not up-to-par. We also have plurals, that we don't support yet. And the CDATA hack we use for markup isn't the best solution either.
Which makes me wonder, should we have an Android rich editor, like we do for Fluent?
Comment 7•5 years ago
|
||
Another community is reporting issues with this and says that they can't localize without a solution. Since this is affecting Fenix l10n, we need to prioritize a solution.
(In reply to Axel Hecht [:Pike][back 03/16] from comment #6)
I was wondering about what we want to do with Android mid-term. Looking at https://developer.android.com/guide/topics/resources/string-resource, escaping is just one thing that's not up-to-par. We also have plurals, that we don't support yet. And the CDATA hack we use for markup isn't the best solution either.
Which makes me wonder, should we have an Android rich editor, like we do for Fluent?
That's definitely a conversation we should all have, can you set up a time or file a new bug where we can discuss?
Comment 8•5 years ago
|
||
Update: this is also an issue for the Breton locale
Comment 10•4 years ago
|
||
Updated•4 years ago
|
Description
•