User tests: Successful: Unsuccessful:
Pull Request resolves # .
TL:DR we don't need special code to ensure ( ) are not displayed as ) ( when we mix LTR and RTL text in the same string as seen when we have a language selection - we did need this 10_ years ago but no more
AI rewrite - to try and make my rambling explanation first draft understandable
This PR removes the use of the Unicode Left-to-Right Mark (‎, U+200E) where it was previously added to correct the display of parentheses in RTL languages.
The workaround was originally introduced to address problems with the rendering of paired parentheses in bidirectional text. However, this behaviour is now handled automatically by modern implementations of the Unicode Bidirectional Algorithm (UBA).
The additional directional marks are therefore no longer necessary for this purpose and can be removed.
Historically, browsers did not always correctly handle paired parentheses when displaying mixed-direction text.
For example, consider an Arabic label containing an English word in parentheses:
اسم الحقل المخصص (text)
The Arabic text reads from right to left, while the English word reads from left to right. Older implementations of the bidirectional algorithm could display the parentheses incorrectly.
اسم الحقل المخصص )text(
Joomla previously worked around this problem by appending an invisible Left-to-Right Mark (‎) to the affected strings.
However, this is no longer necessary with modern browser implementations.
The Unicode Consortium introduced improvements to the Unicode Bidirectional Algorithm in Unicode 6.3 (September 2013). These included paired bracket detection and resolution, allowing browsers to correctly handle matching parentheses and brackets in bidirectional text.
The W3C Internationalization Working Group explicitly documents this improvement in its article:
[Inline markup and bidirectional text in HTML – W3C](https://www.w3.org/International/articles/inline-bidi-markup/)
Under the section Mirrored characters, the W3C explains that up-to-date implementations of the bidirectional algorithm automatically balance parentheses. No additional directional characters or other intervention are required.
The W3C also provides a browser test suite covering this behaviour:
[W3C – Bidirectional algorithm browser tests](https://www.w3.org/International/i18n-tests/results/bidi-algorithm)
These tests specifically cover paired parentheses, square brackets and curly brackets in RTL contexts.
The underlying Unicode specification is also documented here:
[Unicode Standard Annex #9 – Unicode Bidirectional Algorithm](https://www.unicode.org/reports/tr9/)
Since this behaviour is now handled by modern browsers, continuing to insert invisible directional marks for this particular purpose is an unnecessary workaround.
This PR removes those obsolete additions without changing the underlying text, markup or intended presentation.
There should be no visible change to Joomla's interface.
The removal simply allows the browser's native bidirectional algorithm to handle paired parentheses, rather than relying on additional invisible directional characters inserted by Joomla.
No changes to translations or language packs are required.
This change does not attempt to remove directional marks used for other purposes, such as isolating mixed-direction text, numbers or other content where explicit directional control is still necessary and I will review the methods used for those in a later PR
Important: There should be NO visual change as a result of this PR.
The purpose of testing is to confirm that the existing presentation remains exactly the same after removing the unnecessary directional marks.
Testing should be performed using a genuine RTL language such as Arabic or Hebrew. Simply changing the RTL setting of an English language pack is not sufficient to reproduce the same bidirectional text behaviour.
The W3C browser tests linked above can also be used to independently verify the browser's handling of paired parentheses in an RTL context.
Expected result: All affected labels and interface elements should look identical before and after this change. There should be no reversed parentheses, unexpected character ordering or other visual differences.
Please select:
Documentation link for guide.joomla.org:
No documentation changes for guide.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed
| Status | New | ⇒ | Pending |
| Category | ⇒ | Administration com_fields com_languages Modules Installation |
| Labels |
Added:
PR-6.3-dev
|
||
I have tested this item ✅ successfully on 3e97606
I have tested this PR fix. Thank you @brianteeman!
I have tested this item ✅ successfully on 3e97606
I have tested this PR fix. Thank you @brianteeman!
I have tested this item ✅ successfully on 3e97606
I have tested this item ✅ successfully on 3e97606
I have tested this item ✅ successfully on 3e97606
With the rise of AI, the issue of RTL in its chat box is an important and problem-filled matter.
It was informative.
| Status | Pending | ⇒ | Ready to Commit |
RTC
Bonus - another phpstan exception bites the dust