Displaying bi-directional text starting with weak or neutral characters.
-
I have a text string which starts with a bracket as in the example below:
(x) hello world
This displays correctly in left to right languages, but not in right to left languages. The same string translated into Arabic displays incorrectly as follows:
(x) مرحبا العالم
whereas I would expect it to display:
مرحبا العالم (x)
I've been trying to find a way by using horizontal alignment and/or layout mirroring as specified here http://qt-project.org/doc/qt-5.1/qtquick/qtquick-positioning-righttoleft.html to correctly display the string. I've also tried setting the layout direction at the application level but this doesn't work either.
The only conclusion I can come to now is that special processing will be necessary on strings such as this to add the explicit right to left embedding marks (RLE).
I've read somewhere that translators are expected to add such embedding levels but this isn't a robust solution considering some of our translated strings contain placeholders for text which is obviously unknown at translation time.
Has anyone else come across this issue and if so, did you find a suitable solution?