This content has been marked as final.
Show 1 reply
-
1. Re: Seam Internationalization
lincolnthree Mar 2, 2010 7:30 PM (in response to cbkihong.cbkihong.hotmail.com)I'm going to be looking in to this for Seam 3. In the mean time, you can do it yourself by taking a few steps;
Decorate the view-handler (Create a new class that extends and wraps the existing ViewHandler.) This ViewHandler will need to be registered in faces-config.xml under: <application><view-handler>com.your.ViewHandlerDecorater
Your viewHandler must accept a ViewHandler in the constructor as an argument; you must ensure that your ViewHandler delegates all methods to the parent viewHandler that was received in the constructor (keep it as a local variable.)
In the restore/createView() methods, intercept the viewId, determine if there are localizations available (/home_en.seam, etc...) replace the viewId with the appropriate locale viewId, then pass that viewId to the parent viewHandler. Faces will continue rendering normally, however, be careful here because the output of links and forms may display the localized view path (you might want this anyway.)
It's pretty clean and easy to tie in to the existing locale settings since you're in a faces context already.