You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@click.apache.org by dshah <di...@exit41.com> on 2010/01/12 22:35:28 UTC
Internationalization of an app using Click
Hi,
I am wondering what would be the correct way to implement
internationalization using Click?
Thoughts?
Dipita
--
View this message in context: http://n2.nabble.com/Internationalization-of-an-app-using-Click-tp4294616p4294616.html
Sent from the click-user mailing list archive at Nabble.com.
Re: Internationalization of an app using Click
Posted by Bob Schellink <sa...@gmail.com>.
Hi Dipita,
As WarnerJan said the easiest way to externalize properties is in a click-page.properties file that
you place in the root of your src tree:
src/click-page.properties
src/click-page_fr.properties
src/click-page_de.properties
click-page.properties is for globally scoped page messages. Click also supports page specific
messages by specifying a properties file with the same name and in the same package as page:
src/com/corp/Login.java
src/com/corp/Login.properties
src/com/corp/Login_fr.properties
src/com/corp/Login_de.properties
Properties can also be looked up from Control specific property files but its only rarely needed.
See the following doc on how Message properties are looked up:
http://incubator.apache.org/click/docs/user-guide/html/ch03s04.html
Also see this FAQ:
http://incubator.apache.org/click/docs/faq.html#localization
kind regards
bob
WarnerJan Veldhuis wrote:
> The standard I18N rules apply, so you create a click-page.properties,
> and all the languages as click-page_[your country/lang code].properties.
> So a Dutch page would be click-page_nl.properties etc.
>
> The locale will be used from the request, but you can explicitly set the
> locale in the context.
> (http://incubator.apache.org/click/docs/click-api/org/apache/click/Context.html#setLocale(java.util.Locale))
>
>
> Cheers,
>
> WarnerJan
>
>
>
>
> On 12-Jan-10 22:35, dshah wrote:
>> Hi,
>> I am wondering what would be the correct way to implement
>> internationalization using Click?
>>
>> Thoughts?
>> Dipita
>>
>
Re: Internationalization of an app using Click
Posted by WarnerJan Veldhuis <wa...@qprcostcontrol.com>.
The standard I18N rules apply, so you create a click-page.properties,
and all the languages as click-page_[your country/lang code].properties.
So a Dutch page would be click-page_nl.properties etc.
The locale will be used from the request, but you can explicitly set the
locale in the context.
(http://incubator.apache.org/click/docs/click-api/org/apache/click/Context.html#setLocale(java.util.Locale))
Cheers,
WarnerJan
On 12-Jan-10 22:35, dshah wrote:
> Hi,
> I am wondering what would be the correct way to implement
> internationalization using Click?
>
> Thoughts?
> Dipita
>