Author: tchemit Date: 2011-01-21 12:39:41 +0100 (Fri, 21 Jan 2011) New Revision: 1856 Url: http://nuiton.org/repositories/revision/i18n/1856 Log: english doc Modified: trunk/src/site/apt/index.apt trunk/src/site/en/apt/application.apt trunk/src/site/en/apt/helloWorld.apt trunk/src/site/en/apt/index.apt Modified: trunk/src/site/apt/index.apt =================================================================== --- trunk/src/site/apt/index.apt 2011-01-21 11:06:47 UTC (rev 1855) +++ trunk/src/site/apt/index.apt 2011-01-21 11:39:41 UTC (rev 1856) @@ -84,14 +84,9 @@ I18n.init(I18nInitializer, Locale); -------------------------------------------------------------------------------- - Les méthodes <n_(String)>, <_(String)> ont été dépréciées et seront supprimées en version 3.0. - - - - Quoi de nouveau dans la version 2.0 Depuis la version 2.0, les bundles i18n générés (dans <src/main/resources/i18n>) Modified: trunk/src/site/en/apt/application.apt =================================================================== --- trunk/src/site/en/apt/application.apt 2011-01-21 11:06:47 UTC (rev 1855) +++ trunk/src/site/en/apt/application.apt 2011-01-21 11:39:41 UTC (rev 1856) @@ -55,19 +55,17 @@ package org.myOrganisation.myApplication; import org.myOrganisation.myLibrary.myLibrary; -import static org.nuiton.i18n.I18n._; -import static org.nuiton.i18n.I18n.init; -import static org.nuiton.i18n.I18n.setInitializer; +import org.nuiton.i18n.I18n; import org.nuiton.i18n.init.DefaultI18nInitializer; +import java.util.Locale; public class myApplication { public static void main(String[] args){ - setInitializer(new DefaultI18nInitializer("myApplication-i18n")); - init("fr","FR"); + I18n.init(new DefaultI18nInitializer("myApplication-i18n"), Locale.FRANCE); - System.out.println(_("String to translate in my application")); + System.out.println(I18n._("String to translate in my application")); myLibrary.myMethod(); } } Modified: trunk/src/site/en/apt/helloWorld.apt =================================================================== --- trunk/src/site/en/apt/helloWorld.apt 2011-01-21 11:06:47 UTC (rev 1855) +++ trunk/src/site/en/apt/helloWorld.apt 2011-01-21 11:39:41 UTC (rev 1856) @@ -69,7 +69,7 @@ not know whiwh language to load. We will then modify our class adding the line ---- -org.nuiton.i18n.I18n.init("fr","FR"); +org.nuiton.i18n.I18n.init(Locale.FRANCE); ---- Modified: trunk/src/site/en/apt/index.apt =================================================================== --- trunk/src/site/en/apt/index.apt 2011-01-21 11:06:47 UTC (rev 1855) +++ trunk/src/site/en/apt/index.apt 2011-01-21 11:39:41 UTC (rev 1856) @@ -52,6 +52,9 @@ - {{{./maven-i18n-plugin/index.html}I18n Maven Plugin}} What's new in 2.1 version + +* News in maven plugin + It is now possible to generate a default locale (for example myTranslations.properties) using the generateDefaultLocale option in your pom. @@ -60,6 +63,32 @@ for UIBinder screens, you can manage all the translations of your application using nuiton-i18n. +* News in api + + It is now possible to specify the locale to use for a translation using the + method <l_> : + +-------------------------------------------------------------------------------- +I18n.l_(Locale.FRANCE, "To translate"); +-------------------------------------------------------------------------------- + + So now it is possible to use I18n for some application like web one by + passing the user's locale. + + + This new mode of translation required to review the initialisation of I18n, + which is now simplier and improved. Some methods were depreciates and will be + removed in version 3.0. + + At the end (in version 3.0), only one init method should stay : + +-------------------------------------------------------------------------------- +I18n.init(I18nInitializer, Locale); +-------------------------------------------------------------------------------- + + Methods <n_(String)>, <_(String)> has been depreciate and will also be removed + in version 3.0. + What is new in the 2.0 version Since 2.0 version, the generated i18n bundles (in <src/main/resources/i18n>)
participants (1)
-
tchemit@users.nuiton.org