Force ltr on some content to prevent display errors on rtl languages
When we serve pages on rtl languages (Arabic, Persian, Hebrew) the content of the pages is 'flipped'. This can cause problems with some strings that are commands, or are meant to stay on English (and thus, ltr).
The bidirectional algorithm sees the latin characters and stays on ltr, but some characters that are considered direction-neutral can cause confusion. These are mostly punctuation (also #, $ etc.)
For example, in https://tb-manual.torproject.org/ar/installation/ the command line options, that are meant to be run in a terminal that is always ltr, we see:
Wrong | Correct |
---|---|
And similar problems occur with lines that start with # or $.
I have been thinking about this problem and I would like to add the Unicode character 202A (right to left mark) to the start of this sentences. I want to do that because I want to mark those translations on Transifex as being 'notranslate', so I am able to copy them in bulk and mark them as translated.
In this way, they will always appear well, independently of the direction of the text of the page, or if they are translated or not.
It will embed the directionality on the content, instead of letting the bidi algorithm decide.
The problem may be that this strings are going to be confusing because not many editors are able to show them, but these are strings that are not meant to cause much trouble. They are mostly commands or snippets of configuration files.