In Tap4, you have access to the locale in the page with the method
getLocale(), it returns the current locale of the user. The default
locale used by tapestry is the one of the JVM thus of your system.
If you want another default locale you have to override the meta key
"org.apache.tapestry.accepted-locales" in the application spec with
the list of locales you intend to accept.
You can find everything on:
http://tapestry.apache.org/tapestry4/UsersGuide/localization.html
Numa
Le 13 févr. 07 à 15:01, Stephane Decleire a écrit :
Thanks Numa but how do you get the locale of the user ?
It seems that my application always takes the locale of my server
but not the clients locale ...
--
Stéphane Decleire
Numa Schmeder a écrit :
Hi,
You can use all standard java localization recommandation:
SimpleDateFormat
NumberFormat etc....
All localized message are stored in a global property file:
myApp_en.properties (for english messages)
OR
in a per page or per component basis in the web-inf:
myPage.properties (default)
myPage_en.properties
myPage_fr.properties
To format a date in the correct locale in the html using ognl:
For date
@[EMAIL PROTECTED]
(@[EMAIL PROTECTED],@[EMAIL PROTECTED], locale)
For time
@[EMAIL PROTECTED](@[EMAIL PROTECTED],
locale)
For Numbers
@[EMAIL PROTECTED](locale)
Numa
Le 13 févr. 07 à 14:37, Stephane Decleire a écrit :
Hi,
Is there a prefered way to deal with user localization in
Tapestry ? I mean how to print dates, numbers, etc ... according
to the localization of the user (say based on the user choice or
on his browser configuration) ?
Thanks in advance.
--
Stéphane Decleire
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]