Re: i18n
Michael Nash <[email protected]> Fri, 02 Sep 2005 10:00:28 -0400
| Newsgroups | gmane.comp.java.keel.devel |
|---|---|
| Organization | JGlobal Limited |
| Message-ID | <1125669627.30054.0.camel@139-142-200-104> |
Pierre: I see that keel-common now requires 0.1 of commons-resources, but I can't locate that jar anywhere. Do you have a place to get this? Mike On Fri, 2005-08-26 at 06:39, Raoul Pierre wrote: > Hello, > > I just commited patches to move dynamic message from clnt-struts to > keel-client. > > The treatment of dynamic messages is now implanted in > DefaultClientConnector. The job is done by an new class > DynamicMessageSupport in keel-common, with Apache library commons-resources. > > I moved the properties files from conf/client/struts to > conf/clients/resource, a more client neutral place. I used > ResourceBundle Editor for Eclipse to sort the messages: very nice tool > to work with i18n messages. > > Howto : > > Below "key" is the symbolic name of a bundle. > > - In each direct sub-class of DefaultClientConnector, defined a function > setDefaultKeys, which can add key(s) to the default key list. This > function can be called from function "execute" as soon as kres is > defined with a "model" attribute (if required). > This function "setDefaultKeys" must call: > * DefaultClientConnector.initDefaultKeys(kres) to initialize the > default key list, > * then DefaultClientConnector.getDefaultKeys() to get this default key > list and add new key(s). > > Use DefaultClientConnector.addFirstDefaultKey(...) and > DefaultClientConnector.addLastDefaultKey(...) to add any key at the > beginning or at the end of the list. > It is recommended to defined setDefaultKeys as private. > > - In a derived class, e.g. StrutsClientConnector, in function "execute" > insert a call to DefaultClientConnector.internationalize(...). This > function will do all the job! > > It is also possible to call > DefaultClientConnector.translateString(...), like StrutsClientConnector > with the error messages. > > Normally, sub-classes don't need to do anything else about i18n but > eventually to define their own function setDefaultKeys. > > ==== > > AbstractDesktopClientConnector is ready to i18n. > > Todo: > - put i18n in non Struts Client connectors > - it may be necessary to add script(s) in plugin.jelly > (tool-maven-plugin) for clients other than Struts. > - add a function "translateMessage" in DefaultClientConnector. > - in StrutsClientConnector.errorhandle, do a "final" translation of > error messages. > > Pierre > > > > http://keelframework.org/documentation.shtml > Keelgroup mailing list > [email protected] > http://lists.keelframework.com/listinfo.cgi/keelgroup-keelframework.com http://keelframework.org/documentation.shtml Keelgroup mailing list [email protected] http://lists.keelframework.com/listinfo.cgi/keelgroup-keelframework.com