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


Reply via email to