You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xap-user@incubator.apache.org by Jacques Le Roux <ja...@les7arts.com> on 2008/02/19 23:07:01 UTC
Internationalisation
Hi,
I would like to know how XAP is dealing with i18n ?
Thanks
Jacques Le Roux
Re: Internationalisation
Posted by Jacques Le Roux <ja...@les7arts.com>.
Thanks James,
I will have a deeper look
Jacques
From: "James Margaris" <jm...@nexaweb.com>
> There are a couple ways to approach it. If you are using JSP
> pages/servlets or some other server-side approach you can do the
> internationalization there.
>
> Otherwise it's possible to write code that relies on dojo's i18n
> support. This can be done by declaring a client-side code object and
> using the resolution syntax. For example, you can do something like
> this:
>
> <button text="{mco:myMco.getString('buttonText')}"/>
>
> Here "myMco" is a little MCO (3 lines or so) you wrote that uses dojo
> i18n support to look up internationalized text for the message called
> "buttonText". The {...} is an example of resolution syntax, it means the
> getString() method will be run and the value of the "text" attribute
> will be set to the result.
>
> I have an example sitting on my machine that I never checked in. I'll
> check it into trunk now. It's
> samples/examples/widgets/internationalization.xal
>
> The supporting files are in samples/examples/widgets/i18n and
> samples/examples/widgets/src-js
>
> I haven't tried it in a while, it should still work. Feel free to ask
> more questions. It's a pretty cool use of the resolution syntax.
>
> James Margaris
>
> -----Original Message-----
> From: Jacques Le Roux [mailto:jacques.le.roux@les7arts.com]
> Sent: Tuesday, February 19, 2008 6:07 PM
> To: xap-user@incubator.apache.org
> Subject: Internationalisation
>
> Hi,
>
> I would like to know how XAP is dealing with i18n ?
>
> Thanks
>
> Jacques Le Roux
>
>
Re: Internationalisation
Posted by Jacques Le Roux <ja...@les7arts.com>.
Thanks James,
I will have a deeper look
Jacques
From: "James Margaris" <jm...@nexaweb.com>
> There are a couple ways to approach it. If you are using JSP
> pages/servlets or some other server-side approach you can do the
> internationalization there.
>
> Otherwise it's possible to write code that relies on dojo's i18n
> support. This can be done by declaring a client-side code object and
> using the resolution syntax. For example, you can do something like
> this:
>
> <button text="{mco:myMco.getString('buttonText')}"/>
>
> Here "myMco" is a little MCO (3 lines or so) you wrote that uses dojo
> i18n support to look up internationalized text for the message called
> "buttonText". The {...} is an example of resolution syntax, it means the
> getString() method will be run and the value of the "text" attribute
> will be set to the result.
>
> I have an example sitting on my machine that I never checked in. I'll
> check it into trunk now. It's
> samples/examples/widgets/internationalization.xal
>
> The supporting files are in samples/examples/widgets/i18n and
> samples/examples/widgets/src-js
>
> I haven't tried it in a while, it should still work. Feel free to ask
> more questions. It's a pretty cool use of the resolution syntax.
>
> James Margaris
>
> -----Original Message-----
> From: Jacques Le Roux [mailto:jacques.le.roux@les7arts.com]
> Sent: Tuesday, February 19, 2008 6:07 PM
> To: xap-user@incubator.apache.org
> Subject: Internationalisation
>
> Hi,
>
> I would like to know how XAP is dealing with i18n ?
>
> Thanks
>
> Jacques Le Roux
>
>
RE: Internationalisation
Posted by James Margaris <jm...@nexaweb.com>.
There are a couple ways to approach it. If you are using JSP
pages/servlets or some other server-side approach you can do the
internationalization there.
Otherwise it's possible to write code that relies on dojo's i18n
support. This can be done by declaring a client-side code object and
using the resolution syntax. For example, you can do something like
this:
<button text="{mco:myMco.getString('buttonText')}"/>
Here "myMco" is a little MCO (3 lines or so) you wrote that uses dojo
i18n support to look up internationalized text for the message called
"buttonText". The {...} is an example of resolution syntax, it means the
getString() method will be run and the value of the "text" attribute
will be set to the result.
I have an example sitting on my machine that I never checked in. I'll
check it into trunk now. It's
samples/examples/widgets/internationalization.xal
The supporting files are in samples/examples/widgets/i18n and
samples/examples/widgets/src-js
I haven't tried it in a while, it should still work. Feel free to ask
more questions. It's a pretty cool use of the resolution syntax.
James Margaris
-----Original Message-----
From: Jacques Le Roux [mailto:jacques.le.roux@les7arts.com]
Sent: Tuesday, February 19, 2008 6:07 PM
To: xap-user@incubator.apache.org
Subject: Internationalisation
Hi,
I would like to know how XAP is dealing with i18n ?
Thanks
Jacques Le Roux