I need to process some language files. Most of them are in left-to-right languages, but some are in right-to-left languages. Processing the right-to-left languages ir problematic.
I have read a localizedString
variable from a file.
If I print it reads correctly (first line in the attached picture). However, when I run this line:
outputString = '"' + stringKey + '" = "' + localizedString + '";\n'
The arabic text gets out of order (second line).
I cannot even paste it here properly, upon pasting it gets out of order.
How can I automatically keep the proper order without knowing the language in advance?
I guess I could do what's explained in this SO answer, but that would break left-to-right languages. I'm looking for an automatic way of doing this regardless of the language.
Note: I'm using Python 2.7.6
IMO, you could just simply concat them.
let the display problem to the edit itself. You may need convert it to .doc or .odt if you want to use it in desktop environment. Or just recompile vim with +rightleft options. However, you language file processing program can keep simple and elegant.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With