Some languages use special rules that require modifying their characters depending on whatever they are located at the beginning, end or middle of a word as well as what characters have in front and after. Also, some of them are rendered from the right toward the left.


I2 Localization knows which languages need to be changed (there is a list of those in LocalizationManager.LanguagesRTL) and automatically applies the necessary modifications for them to render correctly.




The plugin also allows multi-line wrapping. If a normal approach were used, the Right-To-Left languages will start at the upper-right instead of at the lower-right as it is expected.


Solving that issue its not straight forward given that the rendering is performed by third party plugins (NGUI, TMPro, uGUI, etc) and most of them don't have an stable method of querying where they are going to split the lines. Also, I2L could inject some code in NGUI and TMPro, but it can get messy if they do big updates to their plugins.


In the meantime, a workaround was implemented to help to feed the third party plugins the text already splitted.


Instead of dynamically querying the renderer about the text size, which most of the time its only known right before rendering, the Localize inspector now has two more options, one if them specifies the maximum number of characters that can fit in the label. I2L splits the text into lines with that length and applies RTL fix for each individual line to correct the characters.



The other option is a checkbox for adjusting the Alignment if the language is Right-To-Left.

It will make the text align to the Right when the language is RTL and to the Left if its not RTL. (Vertical alignment is maintained)


Also there is an option to completely bypass the RTL processing in case the texts are known to be already right.


Created with the Personal Edition of HelpNDoc: Easy to use tool to create HTML Help files and Help web sites