I believe some use CSS styles to achieve internationalization, although 
currently LZX does not support dynamically changing styles, so I'm not sure 
exactly how this is handled.  Currently, styles need to be pre-processed by the 
compiler.  Ideally, you would have your application server looking at the 
browser request language preference and serve up different style sheets based 
on that.  It may be that people are using a .jsp to do this kind of dispatching.

In theory, you would write something like:

<!-- supply style sheet based on browser language -->
<stylesheet>
  i18ntext [label="hi"] { text: "hello" }
</stylesheet>

<class name="i18ntext" extends="text">
  <attribute name="label" type="string" />
  <attribute name="text" style="text" />
</class>

<i18ntext label="hi" />


On 2010-02-15, at 08:34, cem sonmez wrote:

> hi all
> I am tring to do some operations about internationalization. And I am a bit
> confused how to manage this.
> 
> assume this xml :
> *words.xml*
> -----------------
> <words>
>    <word id="1" name="hi">
>        <value>hello</value>
>    </word>
>    <word id="2" name="hi">
>        <value>merhaba</value>
>    </word>
> </words>
> 
> and dataset for it :
> 
> <dataset name="dset" src="words.xml" />
> 
> and i want to change any buttons text depend on the datapointer(for *id*) of
> dset.
> So, i am planning to do this via declaring a label attribute of the
> components and implementing a setter for this attribute that is going to be
> set by the datapointer value.
> And to do this, i have to add these like lines to any component that i will
> use.
> 
> <attribute name="label" type="number" setter="setLabel(labelId)" />
> <method name="setLabel" args="labelId" >
>     this.label = labelId;
>     this.setAttribute('text',canvas.getLabelName(this.label)()); <!--coming
> from the datapointer as the value of the given id-->
> </method>
> 
> As a result :)
> 
> To do this, I have to do this implementation in each component class
> definition(i.e button, text, window). My question is : has anyone have an
> idea how can i manage to do this in an easier way. just this way come to my
> mind.
> 
> Thanks in advance
> Regards
> 
> -- 
> Cem SONMEZ


Reply via email to