Translating Arabic to English causes punctuation to be presented incorrectly
Categories
(Firefox :: Translations, defect)
Tracking
()
People
(Reporter: gregtatum, Assigned: nordzilla)
References
Details
Attachments
(2 files)
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
phab-bot
:
approval-mozilla-beta+
|
Details | Review |
Translating an RTL page to LTR causes punctuation to be presented incorrectly.
For instance, with the phrase: "What is Open Source?" the "?" is not strongly LTR so it gets placed at the beginning of the sentence. "?What is Open Source". This is because the block element is RTL, but the text is ambiguous until the first strongly LTR character.
The solution here is to use bidi isolate characters.
U+2066 - Left-to-Right Isolate (LRI)
U+2067 - Right-to-Left Isolate (RLI)
U+2069 - Pop Directional Isolate (PDI)
So in this case:
"\u2066What is Open Source?\u2069"
This would fix the presentation of the text. For LTR to RTL you would use the corresponding U+2067.
| Reporter | ||
Comment 1•1 year ago
|
||
Here is a really good test page: https://linux-2-day.com/
| Assignee | ||
Comment 2•10 months ago
|
||
This patch applies the target-language script direction
to elements with translatable content within within the
TranslationsDocument. This preserves the core layout of
the page, while still ensuring that translated text
displays correctly.
Updated•10 months ago
|
Comment 5•9 months ago
|
||
firefox-beta Uplift Approval Request
- User impact if declined: This is a non-risky patch that contains substantial quality-of-life improvements for translating between LTR and RTL languages (e.g. Arabic ↔ English).
Given the low risk, and that we are in very early beta, I would like to get this shipped sooner than later.
- Code covered by automated testing: yes
- Fix verified in Nightly: no
- Needs manual QE test: yes
- Steps to reproduce for manual QE testing: Steps are provided in the bug comments, RE: https://linux-2-day.com
- Risk associated with taking this patch: low
- Explanation of risk level: This is a very low-risk patch. The only changes are adding attributes to HTML elements which is quite safe, and this patch is covered by automated testing.
- String changes made/needed: None.
- Is Android affected?: yes
| Assignee | ||
Comment 6•9 months ago
|
||
This patch applies the target-language script direction
to elements with translatable content within within the
TranslationsDocument. This preserves the core layout of
the page, while still ensuring that translated text
displays correctly.
Original Revision: https://phabricator.services.mozilla.com/D267441
Updated•9 months ago
|
Updated•9 months ago
|
Updated•9 months ago
|
Updated•9 months ago
|
Comment 8•9 months ago
|
||
I've reproduced this issue using an affected Nightly build (2025-07-03) on Win 11.
The issue is verified as fixed on latest Nightly 146.0a1 and Beta 145.0b3 under Win 11, macOS 28 and Ubuntu 24.
Description
•