From: Alistair Y. <ali...@sm...> - 2005-05-24 21:28:15
|
I've updated it all to use ResourceBundle: http://www.weblogs.uhi.ac.uk/sm00ay/?p=3D86 Before you can use the new system, you'll have to delete your useroptions.html compiled class - that's the only one that's localised at the moment. I've created a new "res" dir in the root of the tree: res/templates res/facility - e.g. for holding class strings I haven't modified the build file to copy the res dir to WEB-INF/classes yet. Will do that tomorrow. The file paths dependencies are all gone now so it should work on windows= . One consequence of the resources as ResourceBundles in the classpath is, if you change one, it does funny things to bod, like logs you out! They are classes after all. So, if you change a string, you have to reload the webapp. The nice thing is they now use Locale, which is derived from User.getLanguage(). The templates now only have to specify what the class name of their resource file is: <i18n resource-file=3D"res.templates.useroptions.strings" /> and ResourceBundle coupled with Locale with get the correct properties file loaded up from the classpath. useroptions.html also contains a debug level chooser so you can see where templates are getting their strings from. There are two languages supported at the moment - English and Gaelic. You can try them out in useroptions.html Alistair --=20 Alistair Young Senior Software Engineer UHI@Sabhal M=F2r Ostaig Isle of Skye Scotland |