Re: [Webwork-user] Localization i18n
Brought to you by:
baldree,
rickardoberg
From: Rickard O. <ri...@te...> - 2000-12-03 16:07:29
|
> Has there been any explicit effort/thought/desing to handle construction of > multilingual websites? Maybe a example that can "on-the-fly" change between > Swedish, English, and a couple of other languages? Some explicit, but most of it implicit. The explicit part is that WebWork taglib names can refer to ResourceBundles. Like this: <webwork:property name="texts:foo"/> This can translate into the call getTexts().getString("foo") if the result of getTexts is a ResourceBundle. Also, ActionSupport has a method getLocale() which simply returns the system locale. This can be overridden by apps that want to support internationalization. Custom implementations of this method can, for example, check the session for the chosen locale, or perhaps check the HTTP request URI (let's say the URI is "/en/foo.jsp", then the getLocale() method could extract the "en" part as the chosen locale). There are no rules from WebWorks point of view on how to do this, but these are suggested implementation options. With regard to the implicit part of i18n, see my post on skins. Basically one could have a skin per language, where there would be no functional difference between each skin, but they would contain content with different languages. When I get the time (*phew* I'm a busy fellow, so any volunteers would be appreciated on this one) I will update the HelloWorld app to do i18n for English and Swedish. /Rickard |