Support > Elxis 2008 developers guide

Multilingual XML with custom language files

<< < (2/3) > >>

Farhad Sakhaei:
good , very thanx john  :) ;)
but what about some fields that they give persian text ? they should be RTL !

datahell:
As you understand Elxis can not guess the kind of information a text field contains. If for example it is a URL, a module suffix or your real name. Textareas were left intact in order to be able to write RTL. Text inputs for parameters (only) became always LTR as you more often write there latin text like prefixes and numbers.

Farhad Sakhaei:
ok john, can i change some of them (textboxes) that they should be RTL ?
for example can i edit the codes , and decide which textbox should be LTR and RTL ?
in elxis 2006 , we cannot change the direction of parameters of modules , mambot , components ...
can i set them by adding a code or not ?
if we can do this , it will be very good , if not , i want that all textboxes leave without any direction property ...

datahell:
You know better RTL than me, so your wish now fullfilled. Here is the total RTL solution for XML parameters.
Please use it as a general guide:

A new (optional) node can be placed inside text and textarea (select fields should always be ltr, is this right? ). It's name is dir and can have 2 values: ltr and rtl (lowercase or uppercase, no matter). If the gemini language constant _GEM_RTL has been set to 1 (selected language is an RTL language) then it is triggered an RTL set mechanism.

If dir is set to ltr or dir wont set at all (for compatibility) then the text direction becomes LTR by default for RTL languages.

Example:
<param name="where_id" dir="ltr" type="text" default="" label="CX_UCD_CSRSID" description="CX_UCD_CSRSIDD" />
or
<param name="where_id" type="text" default="" label="CX_UCD_CSRSID" description="CX_UCD_CSRSIDD" />

Both of the above for RTL languages will generate:
<input type="text" dir="ltr" name="params[where_id]" value="2,3,4,5" class="inputbox" size="" />
for non-RTL:
<input type="text" name="params[where_id]" value="2,3,4,5" class="inputbox" size="" />

If dir is set to rtl then the text direction becomes RTL for RTL languages.

Example:
<param name="where_id" dir="rtl" type="text" default="" label="CX_UCD_CSRSID" description="CX_UCD_CSRSIDD" />
The above will generate for RTL languages:
<input type="text" dir="rtl" name="params[where_id]" value="2,3,4,5" class="inputbox" size="" />

and for non-RTL (rtl node is being ignored):

<input type="text" name="params[where_id]" value="2,3,4,5" class="inputbox" size="" />

I think it is the best solution possible and I hope friends from Iran, Israel etc will be very happy for this.

Developers should use the dir="rtl" node in XML parameters for text and textarea fields that needed to be displayed in RTL for RTL languages. (LTR languages are not affected)

EDIT: For compatibility reasons I reversed default settings. The post was updated!

Farhad Sakhaei:
john , select fields depend on type of its content may be LTR or RTL , for example for a select language it should be LTR because the options are latin words , but for some select boxes , that they have values that they are in language files and they translated , it should be a RTL select box , like : align , positions , sections , categories select boxes and many another ...
however most of TEXTAREAs are RTL in Right to Left languages , but if it contains a code , it should be LTR too ...

i think it is better to insert a direction property for all SELECT , INPUT (Text fields) , TEXTAREA tags , and it is better to don't set any direction value for them , they can be LTR in LTR pages and RTL in RTL pages , so if we want to set any of them to LTR , we can insert a LTR direction value for compatibility in RTL pages to set that fields to LTR and leave another fields to default ...

this is a sample:
we have 5 fileds below :
1- a name text box
2- an email text box
3- a language select box
4- an author name text box
5- an alias for author text box

if we leave dir property to default (not to set any value) they will be :
in a LTR page all of them will be LTR , because we input all textbox values in latin ...
in a RTL page all of them will be RTL , because for default direction , so fields 1,4,5 are in true direction now but fields 2,3 are not in true direction because for latin characters and words , these tags can be set to LTR by adding a dir="ltr" property ...

i think , another solution to set default value for all properties (set LTR or not set any values) is gathering a statistic from all modules and components and mambots , we can count the number of parameters , count of RTL fields and LTR fields , if the number of LTR fields are more than RTLs or not , so we can decide that they will be set to LTR or not to set any value ...
i will write here a statistics about numbers of these fields !!!

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version