Closed Bug 1615458 Opened 2 years ago Closed 1 month ago

android-l10n should escape straight apostrophes or double quotes when user submits a translation

Categories

(Webtools Graveyard :: Pontoon, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED MOVED

People

(Reporter: ajtzibsyani, Unassigned)

References

Details

Attachments

(1 file)

Attached image apostrofe en cak.png

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.

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

Status: UNCONFIRMED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED

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?

Component: General → Pontoon
Product: Firefox for Android → Webtools
Version: unspecified → other

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 "

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.

Status: RESOLVED → REOPENED
Ever confirmed: true
Resolution: FIXED → ---
Summary: The use of apostrophe is not allowed in the location of Android L10n in kaqchikel. → android-l10n should escape straight apostrophes or double quotes when user submits a translation
Status: REOPENED → NEW

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:

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.

Priority: -- → P2

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?

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?

Update: this is also an issue for the Breton locale

See Also: → 1605059
Duplicate of this bug: 1605059
*This bug has been moved to GitHub.*

*Please check it out on https://github.com/mozilla/pontoon/issues.*
Status: NEW → RESOLVED
Closed: 2 years ago1 month ago
Resolution: --- → MOVED
Product: Webtools → Webtools Graveyard
You need to log in before you can comment on or make changes to this bug.