I have a Web application that needs to support all languages, including Middle-East.
After some reading, it would appear that using the dir
tag does the job in many cases (for instance, text aligns correctly and I have a tables that correctly swap when needed).
I'm using Angular and, within the main controller, I set a global variable as rtl
or ltr
depending on the selected language.
There is, however, a situation in which the swap is not taking place as I'm expecting. There are 4 divs that present textual information as follows:
<div style="width:100%" dir="{{Language_Layout}}">
<div style="width:25%">
{{Text_of_Div_1}}
</div>
<div style="width:25%">
{{Text_of_Div_2}}
</div>
<div style="width:25%">
{{Text_of_Div_3}}
</div>
<div style="width:25%">
{{Text_of_Div_4}}
</div>
</div>
When a western language is selected, these divs appear as:
+--------------++--------------++--------------++--------------+
| || || || |
| || || || |
| <text 1> || <text 2> || <text 3> || <text 4> |
| || || || |
| || || || |
+--------------++--------------++--------------++--------------+
and when a middle-east language is selected, my expectation is that it would show as:
+--------------++--------------++--------------++--------------+
| || || || |
| || || || |
| <text 4> || <text 3> || <text 2> || <text 1> |
| || || || |
| || || || |
+--------------++--------------++--------------++--------------+
To my surprise, the order in which the internal divs are shown remains unchanged (i.e. like in the western language example above).
As stated, I have a table which does revert according to the setting of the Language_Layout
variable.
Could anyone tell me what I'm doing wrong or, perhaps, I shouldn't be expecting the divs to be reversed in their order?
Thanks!!