BiDi substitution review

Current Proposal: http://www.openajax.org/member/wiki/OpenAjax_Metadata_1.0_Specification_Localization http://www.openajax.org/member/wiki/OpenAjax_Metadata_1.0_Specification_Substitution#BIDI_substitution
Currently a set of _BIDI attributes are available:
Current proposal

Currently a set of _BIDI attributes are available:

Variable

Descriptions

_BIDI_START_EDGE_

This variable represents the side of the widget that is the starting point for content display. The value is "left" when the widget is in LTR-mode and "right" when the widget is in RTL-mode.

_BIDI_END_EDGE_

This variable represents the edge of the widget that is opposite to where content display starts. The value is "right" when the widget is in LTR-mode and "left" when the widget is in RTL-mode

_BIDI_DIR_

The value of this variable is "ltr" when the widget is in LTR-mode and "rtl" when the widget is in RTL-mode.

_BIDI_REVERSE_DIR_

The value of this variable is "rtl" when the widget is in LTR-mode and "ltr" when the widget is in RTL-mode.

In the following link the details for different BIDI substitution  {_}http://www.openajax.org/member/wiki/OpenAjax_Metadata_1.0_Specification_Substitution#BIDI_substitution _

What is missing?

  • There is no auto direction detection.
  • The current proposal enable the localized messages to be loaded automatically, but it does not take into consideration the image/icons loading

New proposal

Proposal 1: Adding auto option for Bidi text direction
_BIDI_AUTO_DIR : auto substitution variable that can be useful to manage the rendering of content direction automatically, this will be done as follows
initially based on the context of the text and the presence of strong character, if no strong character exist it will inherit from language_direction 
eventually it will be resolved to ltr or rtl 
 
Example:

<widget ..."
    <Locale lang="ar" messages="localization/ar_ALL.xml" language_direction="rtl"/>
    <content>
<textarea dir="BIDI_AUTO_DIR"/>
]]>
    </content>
</widget>

Proposal 2: Proper image/icon loading
Although most images, e.g. photos, are equally applicable to LTR and RTL pages, some images a need to appear in a mirror image in an RTL page.
For example : arrows  images , if its location was mirrored it may give a different meaning ( e.g previous and next buttons) , therefore the image locationf must be changed to match its action.
Also in some cases the image have to be changed to match its localized content.
For example : spell checker icon may need to be changes to the localized spell checker

This proposal suggest adding icons attribute (similar to the messages attributes of Locale element) to adjust the location of desired image changes inconjunction with an attribute that gets evaluated based on the locale

Example1

<widget ..."
    <Locale lang="ar" messages="localization/ar_ALL.xml" language_direction="rtl" images= "RTLImages/"/>
    <content>
<img src="C:/imagesSources/IMG_AUTO/myimg.jpg"/>
]]>
    </content>
</widget>

Example 2

<widget ..."
    <Locale lang="ar" messages="localization/ar_ALL.xml" language_direction="rtl" images= "RTLImages/location.xml"/>
    <content>
<img id="id1" />
]]>
    </content>
</widget>