This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository i18n. See http://git.nuiton.org/i18n.git commit 34c51986e9db46e016beac9dfc5439b12eead5cf Author: Tony CHEMIT <chemit@codelutin.com> Date: Wed Jul 23 18:38:56 2014 +0200 - improve usage of nuiton-converter - improve site --- nuiton-i18n/pom.xml | 5 + .../src/main/java/org/nuiton/i18n/I18nUtil.java | 8 +- .../org/nuiton/util/converter/LocaleConverter.java | 2 +- nuiton-i18n/src/site/apt/index.apt | 45 ----- nuiton-i18n/src/site/en/apt/index.apt | 45 ----- nuiton-i18n/src/site/site_en.xml | 16 -- nuiton-i18n/src/site/site_fr.xml | 4 - pom.xml | 29 +-- src/site/apt/{index.apt => history.apt} | 54 ----- src/site/apt/index.apt | 219 --------------------- src/site/en/apt/{index.apt => history.apt} | 59 +----- src/site/en/apt/index.apt | 211 -------------------- src/site/site_en.xml | 6 +- src/site/site_fr.xml | 2 +- 14 files changed, 17 insertions(+), 688 deletions(-) diff --git a/nuiton-i18n/pom.xml b/nuiton-i18n/pom.xml index a7f70f5..9e784c9 100644 --- a/nuiton-i18n/pom.xml +++ b/nuiton-i18n/pom.xml @@ -45,6 +45,11 @@ <dependencies> <dependency> + <groupId>org.nuiton</groupId> + <artifactId>nuiton-converter</artifactId> + </dependency> + + <dependency> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> </dependency> diff --git a/nuiton-i18n/src/main/java/org/nuiton/i18n/I18nUtil.java b/nuiton-i18n/src/main/java/org/nuiton/i18n/I18nUtil.java index 25c51aa..a668a0d 100644 --- a/nuiton-i18n/src/main/java/org/nuiton/i18n/I18nUtil.java +++ b/nuiton-i18n/src/main/java/org/nuiton/i18n/I18nUtil.java @@ -27,9 +27,9 @@ package org.nuiton.i18n; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.nuiton.converter.ConverterUtil; import org.nuiton.i18n.format.I18nMessageFormatter; import org.nuiton.i18n.format.StringFormatI18nMessageFormatter; -import org.nuiton.util.converter.LocaleConverter; import java.io.File; import java.io.IOException; @@ -39,7 +39,6 @@ import java.net.URISyntaxException; import java.net.URL; import java.net.URLClassLoader; import java.nio.charset.Charset; -import java.text.MessageFormat; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -84,12 +83,11 @@ public class I18nUtil { public static Locale[] parseLocales(String str) throws IllegalArgumentException { List<Locale> result = new ArrayList<Locale>(); String[] bundlesToUse = str.split(","); - LocaleConverter converter = new LocaleConverter(); for (int i = 0, j = bundlesToUse.length; i < j; i++) { String s = bundlesToUse[i].trim(); // on devrait verifier que le bundle existe try { - Locale l = (Locale) converter.convert(Locale.class, s); + Locale l = (Locale) ConverterUtil.convert(Locale.class, s); result.add(l); } catch (Exception e) { throw new IllegalArgumentException("bundle " + s + @@ -106,7 +104,7 @@ public class I18nUtil { return newLocale(null, null); } try { - return (Locale) new LocaleConverter().convert(Locale.class, str); + return ConverterUtil.convert(Locale.class, str); } catch (Exception e) { if (log.isWarnEnabled()) { log.warn("could not load locale '" + str + diff --git a/nuiton-i18n/src/main/java/org/nuiton/util/converter/LocaleConverter.java b/nuiton-i18n/src/main/java/org/nuiton/util/converter/LocaleConverter.java index 4e3069e..55d0bad 100644 --- a/nuiton-i18n/src/main/java/org/nuiton/util/converter/LocaleConverter.java +++ b/nuiton-i18n/src/main/java/org/nuiton/util/converter/LocaleConverter.java @@ -42,7 +42,7 @@ import static org.apache.commons.logging.LogFactory.getLog; * * @author tchemit <chemit@codelutin.com> * @since 2.0.1 - * @deprecated since 3.2 use instead {@link org.nuiton.converter.LocaleConverter} (<strong>Note:</strong> This converter is no more loaded by the {@link ConverterUtil#initConverters()}) + * @deprecated since 3.2 use instead {@link org.nuiton.converter.LocaleConverter} (<strong>Note:</strong> This converter is no more loaded by the {@link org.nuiton.converter.ConverterUtil#initConverters()}) */ @Deprecated public class LocaleConverter implements Converter { diff --git a/nuiton-i18n/src/site/apt/index.apt b/nuiton-i18n/src/site/apt/index.apt deleted file mode 100644 index 17fb1e5..0000000 --- a/nuiton-i18n/src/site/apt/index.apt +++ /dev/null @@ -1,45 +0,0 @@ -~~~ -~~ #%L -~~ I18n :: Api -~~ -~~ $Id$ -~~ $HeadURL$ -~~ %% -~~ Copyright (C) 2004 - 2010 CodeLutin -~~ %% -~~ This program is free software: you can redistribute it and/or modify -~~ it under the terms of the GNU Lesser General Public License as -~~ published by the Free Software Foundation, either version 3 of the -~~ License, or (at your option) any later version. -~~ -~~ This program is distributed in the hope that it will be useful, -~~ but WITHOUT ANY WARRANTY; without even the implied warranty of -~~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -~~ GNU General Lesser Public License for more details. -~~ -~~ You should have received a copy of the GNU General Lesser Public -~~ License along with this program. If not, see -~~ <http://www.gnu.org/licenses/lgpl-3.0.html>. -~~ #L% -~~~ - ----- -Nuiton-i18n-api ----- ----- -2009-08-22 ----- - -Présentation - - Librairie permettant de rendre les programmes Java multilangue de façon - simple. Il utilise la même philosophie que gettext. C'est à dire que chaque - chaîne de caractères devant être traduite sont tagge avec I18n._("..."). - - Ensuite il suffit d'extraire ces chaînes pour les mettres dans un fichier de - propriété, et d'indiquer quel fichier de propriéttés charger au démarrage de - l'application selon la langue souhaitée. - - - <Veuillez consulter la JavaDoc pour de plus ample détails sur les différentes - librairies.> diff --git a/nuiton-i18n/src/site/en/apt/index.apt b/nuiton-i18n/src/site/en/apt/index.apt deleted file mode 100644 index 17fb1e5..0000000 --- a/nuiton-i18n/src/site/en/apt/index.apt +++ /dev/null @@ -1,45 +0,0 @@ -~~~ -~~ #%L -~~ I18n :: Api -~~ -~~ $Id$ -~~ $HeadURL$ -~~ %% -~~ Copyright (C) 2004 - 2010 CodeLutin -~~ %% -~~ This program is free software: you can redistribute it and/or modify -~~ it under the terms of the GNU Lesser General Public License as -~~ published by the Free Software Foundation, either version 3 of the -~~ License, or (at your option) any later version. -~~ -~~ This program is distributed in the hope that it will be useful, -~~ but WITHOUT ANY WARRANTY; without even the implied warranty of -~~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -~~ GNU General Lesser Public License for more details. -~~ -~~ You should have received a copy of the GNU General Lesser Public -~~ License along with this program. If not, see -~~ <http://www.gnu.org/licenses/lgpl-3.0.html>. -~~ #L% -~~~ - ----- -Nuiton-i18n-api ----- ----- -2009-08-22 ----- - -Présentation - - Librairie permettant de rendre les programmes Java multilangue de façon - simple. Il utilise la même philosophie que gettext. C'est à dire que chaque - chaîne de caractères devant être traduite sont tagge avec I18n._("..."). - - Ensuite il suffit d'extraire ces chaînes pour les mettres dans un fichier de - propriété, et d'indiquer quel fichier de propriéttés charger au démarrage de - l'application selon la langue souhaitée. - - - <Veuillez consulter la JavaDoc pour de plus ample détails sur les différentes - librairies.> diff --git a/nuiton-i18n/src/site/site_en.xml b/nuiton-i18n/src/site/site_en.xml index 9f16d9e..466e788 100644 --- a/nuiton-i18n/src/site/site_en.xml +++ b/nuiton-i18n/src/site/site_en.xml @@ -57,22 +57,6 @@ <item name="English Version" href="./index.html"/> </menu> - <menu name="User"> - <item name="Home" href="index.html"/> - </menu> - - <menu name="Downloads"> - <item - href="${repository.home.url}/org/nuiton/i18n/${project.artifactId}/${project.version}/${project.build.finalName}.jar" - name="Librairie (jar)"/> - <item - href="${repository.home.url}/org/nuiton/i18n/${project.artifactId}/${project.version}/${project.build.finalName}-javadoc.jar" - name="Javadoc (jar)"/> - <item - href="${repository.home.url}/org/nuiton/i18n/${project.artifactId}/${project.version}/${project.build.finalName}-sources.jar" - name="Sources (jar)"/> - </menu> - <menu ref="reports"/> </body> diff --git a/nuiton-i18n/src/site/site_fr.xml b/nuiton-i18n/src/site/site_fr.xml index 47250e6..0d7697f 100644 --- a/nuiton-i18n/src/site/site_fr.xml +++ b/nuiton-i18n/src/site/site_fr.xml @@ -55,10 +55,6 @@ <item name="English Version" href="./en/index.html"/> </menu> - <menu name="Utilisateur"> - <item name="Accueil" href="index.html"/> - </menu> - <menu ref="reports"/> </body> diff --git a/pom.xml b/pom.xml index d4edb2f..1ebba40 100644 --- a/pom.xml +++ b/pom.xml @@ -29,7 +29,7 @@ <parent> <groupId>org.nuiton</groupId> <artifactId>nuitonpom</artifactId> - <version>1.0-SNAPSHOT</version> + <version>1.1</version> </parent> <artifactId>i18n</artifactId> @@ -65,7 +65,7 @@ <projectId>i18n</projectId> <processorVersion>1.3</processorVersion> - <antlrVersion>4.2</antlrVersion> + <antlrVersion>4.3</antlrVersion> <!--Multilanguage maven-site --> <locales>fr,en</locales> @@ -196,7 +196,7 @@ <dependency> <groupId>org.apache.struts.xwork</groupId> <artifactId>xwork-core</artifactId> - <version>2.3.16</version> + <version>2.3.16.3</version> </dependency> <dependency> @@ -257,29 +257,6 @@ <version>${coberturaPluginVersion}</version> </plugin> - <plugin> - <artifactId>maven-project-info-reports-plugin</artifactId> - <version>${projectInfoReportsPluginVersion}</version> - <reportSets> - <reportSet> - <reports> - <report>project-team</report> - <report>mailing-list</report> - <report>cim</report> - <report>issue-tracking</report> - <report>license</report> - <report>scm</report> - <report>dependency-info</report> - <report>dependencies</report> - <report>dependency-convergence</report> - <report>plugin-management</report> - <report>plugins</report> - <report>dependency-management</report> - <report>summary</report> - </reports> - </reportSet> - </reportSets> - </plugin> </plugins> </reporting> </profile> diff --git a/src/site/apt/index.apt b/src/site/apt/history.apt similarity index 84% copy from src/site/apt/index.apt copy to src/site/apt/history.apt index 9e88cca..f9dda8e 100644 --- a/src/site/apt/index.apt +++ b/src/site/apt/history.apt @@ -1,57 +1,3 @@ -~~~ -~~ #%L -~~ I18n -~~ -~~ $Id$ -~~ $HeadURL$ -~~ %% -~~ Copyright (C) 2008 - 2010 CodeLutin -~~ %% -~~ This program is free software: you can redistribute it and/or modify -~~ it under the terms of the GNU Lesser General Public License as -~~ published by the Free Software Foundation, either version 3 of the -~~ License, or (at your option) any later version. -~~ -~~ This program is distributed in the hope that it will be useful, -~~ but WITHOUT ANY WARRANTY; without even the implied warranty of -~~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -~~ GNU General Lesser Public License for more details. -~~ -~~ You should have received a copy of the GNU General Lesser Public -~~ License along with this program. If not, see -~~ <http://www.gnu.org/licenses/lgpl-3.0.html>. -~~ #L% -~~~ - - --- -Nuiton I18n - --- - -Nuiton I18n - - Le projet Nuiton I18n fournit des classes Java pour l'internationalisation - (i18n) des applications. - - Cette librairie très légère combine les très utilisés ResourceBundles Java, une - API simple d'utilisation et très puissante ainsi qu'un procédé d'extension très - utile. De nombreux autre avantages existent à utiliser Nuiton I18n : - - - Extraction des clés de traduction - - - Integration au process de build au travers de Maven ou Ant - - Petit exemple qui démontre la simplicité d'utilisation de Nuiton I18n : - --------------------------------------------------------------------------------- -I18n.init(new DefaultI18nInitializer("myBundle"), Locale.FRANCE); -System.out.println(I18n._("This text will be translated")); --------------------------------------------------------------------------------- - - Les deux modules du projet Nuiton I18n : - - - {{{./nuiton-i18n/index.html}I18n Api}} - - - {{{./maven-i18n-plugin/index.html}I18n Maven Plugin}} Quoi de neuf dans la version 3.0 diff --git a/src/site/apt/index.apt b/src/site/apt/index.apt index 9e88cca..0f3e578 100644 --- a/src/site/apt/index.apt +++ b/src/site/apt/index.apt @@ -52,222 +52,3 @@ System.out.println(I18n._("This text will be translated")); - {{{./nuiton-i18n/index.html}I18n Api}} - {{{./maven-i18n-plugin/index.html}I18n Maven Plugin}} - -Quoi de neuf dans la version 3.0 - -* Compatibilité 1.8 - - Pour être compatible avec java 1.8, des méthodes de la classe I18n ont été renommées - ({{{./migrate.html}Guide de migration}}). - -* Suppression de mojos obsolètes - - Les mojo jsp et tapestry ont été supprimés. - -Quoi de neuf dans la version 2.5 - -* Renommage du plugin en i18n-maven-plugin. - - Le plugin a été renommé de <maven-i18n-plugin> en <i18n-maven-plugin>. - - Pensez à mettre à jour vos pom. - -* Ajout d'un parseur pour les jsp de struts2 - - Ce nouveau parseur scan les fichier jsp et extrait toutes les clefs - contenues dans des attributs text name='xxx' ou label='xxx' ou %\{getText("xxx". - - Malheureusement il n'est pas possible de faire mieux que ça et il se peut - alors de récupérer trop de clefs. Pour limiter cet effet indésirable il est - possible d'utiliser le nouveau paramètre <acceptKeyformat> qui permet de - limiter les clefs remontées. - - De toute manière il ne faut pas oublier qu'une bnne pratique est de toujours - utiliser un prefixe commun à toutes les clefs de traduction (donc le pattern - doit rester simple à écrire). - -* Ajout d'un paramètre <acceptKeyFormat> sur les goals de type parser - - Cela permet de limiter les clefs entrantes (ce qui est nécessaire pour le - parseur struts2...) - -* Permettre de générer un fichier csv avec toutes les traductions d'un bundle - - Cela peut aider grandement à compléter les traduction à partir des - traductions complètes d'une langue. - - Pour utiliser cette fonctionnalité, il suffit d'ajouter à la ligne de - commande <-Di18n.generateCsvFile> lors de l'execution du mojo <bundle>. - - See {{{http://nuiton.org/issues/2291}Evolution #2291: Generate a csv file with all translations for all locales in a csv file in bundle mojo}}. - -Quoi de neuf dans la version 2.4 - -* Meilleure utilisation des encodings - - Depuis la JDK 1.6, il est possible de charger et écrire des fichiers de - propriétés en spécifiant son propre encoding, il n'y a donc plus de raison de - rester sur un encoding ISO-8859-1 ou US/ASCII. - - I18n a intégré ces changements, et il devient donc désormais raisonnable - d'utiliser comme encoding par défaut <UTF-8>. Cet encoding par défaut peut - toujours être modifié à différents niveaux : - - - lors de la génération des fichiers i18n (via le plugin i18n) - - lors de l'initialisation de I18n au runtime via l'initializer ({{{./nuiton-i18n/apidocs/org/nuiton/i18n/init/I18nInitializer.html}I18nInitializer}}). - -* Gestion d'autre formats pour les traductions - - Par défaut, I18n utilise un <String.format> et sa syntaxe pour les traductions. - - Cependant, on peut vouloir utiliser le plugin i18n sans utiliser le runtime - I18n et utiliser à la place un système de traduction basé notamment sur - <MessageFormat> (comme le fait struts2 ou GWT par exemple). - - La version 2.4 permet d'utiliser désormais de changer de syntaxe et ceci - à différents niveaux : - - - au niveau de la génération d'un bundle via le paramètre <<bundleFormatConverter>> du goal <<bundle>> - - au niveau du runtime en spécifiant à l'initializer le bon messageFormatter à utiliser. - (voir l'interface {{{./nuiton-i18n/apidocs/org/nuiton/i18n/I18nMessageFormatter.html}I18nMessageFormatter}}). - - A noter qu'au runtime, les syntaxes de traductions ne peuvent pas être - changées. Utiliser un formatter qui ne correspond pas à la syntaxe des - traductions ne fonctionnera pas correctement. - -Quoi de neuf dans la version 2.3 - - La version 2.3 améliore de façon considérable les temps de détection des clefs - i18n pour les fichiers java (mojo <<parserJava>>). - - Voir {{{http://nuiton.org/issues/show/1275}Evolution #1275: Improve parserJava performance}}. - - On passe à des temps très raisonnable (en dessous de 5 millisecondes par - fichier!) comme montré ci-dessous : - --------------------------------------------------------------------------------- -mvn package -Pnotests -Di18n.strictMode -DnuitonI18nVersion=2.2 - -[INFO] --- maven-i18n-plugin:2.2:parserJava (default) @ observe-business --- -[INFO] Parsing is done. [treated file(s) : 76/187](total time:19.852s) ( ~ 106.158ms / file) -[INFO] --- maven-i18n-plugin:2.2:parserJava (scan-sources) @ observe-swing --- -[INFO] Parsing is done. [treated file(s) : 151/206](total time:38.732s) ( ~ 188.021ms / file) - -mvn package -Pnotests -Di18n.strictMode -DnuitonI18nVersion=2.3-SNAPSHOT - -[INFO] --- maven-i18n-plugin:2.3-SNAPSHOT:parserJava (default) @ observe-business --- -[INFO] Parsing is done. [treated file(s) : 76/187](total time:640.602ms) ( ~ 3.426ms / file) -[INFO] --- maven-i18n-plugin:2.3-SNAPSHOT:parserJava (scan-sources) @ observe-swing --- -[INFO] Parsing is done. [treated file(s) : 151/206](total time:450.823ms) ( ~ 2.188ms / file) --------------------------------------------------------------------------------- - -Quoi de neuf dans la version 2.2 - - La version 2.2 supprimer juste des deux méthodes dépréciées en <2.1> : - --------------------------------------------------------------------------------- -I18n._(String) -I18n.n_(String) --------------------------------------------------------------------------------- - - Il est conseillé d'utiliser dans vos applications directement cette version - et non pas la version 2.1, pour vous éviter des problèmes ensuite... (si par - exemple vous utiliser à plus haut niveau la version 2.2). - -Quoi de neuf dans la version 2.1 - -* Nouveautés dans le module maven - - Il est maintenant possible de générer une locale par défaut (par exemple - mesTraductions.properties) en utilisant l'option generateDefaultLocale dans - votre pom. - - Un <<parserTapestry>> et un <<parserGWTJava>> ont été ajoutés. Le parseur GWT - récupère toutes les clés identifiées par l'annotation @Key. En le couplant - avec le parseurXML, vous pouvez gérer complètement vos traductions avec nuiton-i18n. - -* Nouveautés dans l'api - - Il est possible désormais de spécifier la locale à utiliser pour la traduction - en utilisant la nouvelle méthode - --------------------------------------------------------------------------------- -I18n.l_(Locale.FRANCE, "To translate"); --------------------------------------------------------------------------------- - - Ainsi on peut désormais utiliser I18n pour des applications de type web dans - les couches de services en passant la locale de l'utilisateur. - - Ce nouveau mode de traduction a nécessité de revoir le design d'initialisation - de la librarie qui s'en trouve simplifié et renforcé. Un certain nombre de - méthodes sont dépréciées et seront supprimées en version 3.0. - - Globalement une seule méthode devrait rester dans la version 3.0 : - --------------------------------------------------------------------------------- -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>) - sont compatibles avec l'api java de <ResourceBundle>, à savoir qu'on a - remplacé les <<->> par des <<_>>. - - Avant on avait - ------------------------------------------------------------------------------ -malib-fr_FR.properties ------------------------------------------------------------------------------ - - Et maintenant c'est : - ------------------------------------------------------------------------------ -malib_fr_FR.properties ------------------------------------------------------------------------------ - - * Migration vers la version 2.0 - - Pour utiliser la version 2.0, il faut avant tout renommer dans votre projet - les bundles avant les bons noms (sinon ils seront générés lors de la première - exécution et il est toujours mieux de renommer des fichiers existants pour - conserver l'historique des fichiers dans le gestionnaire de versions). - - Pour ce qui est du mode <<bundle>> (mojo bundle), aucune modification n'est - nécessaire et il restera compatible avec des librairies packagées avec I18n - non en 2.0. - - * Ajout d'un parseur JSP - - Un nouveau parseur JSP a été introduit pour pouvoir intégrer le système de - détection I18n dans des développement web (struts par exemple). - - Jettez un oeil aux tutoriaux pour voir comment enrichir votre application - avec Nuiton I18n. - - * Amélioration des parser xml - - Les parseurs de type xml (actuellement on avait que le <<parserValidation>>) - ont été améliorés dans leur design. Certain paramètres sont devenus communs - à tous les parseurs. Regarder la page de détails de goal pour voir ce qui a - changé. - - On a pu introduire un nouveau parseur <<parserXml>> qui ne contient aucune - règle de détection de clefs (via xpath), l'utilisateur doit les spécifier par - lui même; ce nouveau mojo permet ainsi d'utiliser la détection de clef dans du - xml non pris en charge par le projet. - - * Suppression du module <<I18n ant tasks>> - - Ce module n'est plus maintenu depuis bien longtemps, il est donc désactivé du - build par défaut, il reste cependant dans le projet et est activitable dans un - profile nommé <<ant-task-profile>>. - - Donc pour construire le projet I18n avec ce module il suffit de lancer : - ------------------------------------------------------------------------------ -mvn install -Pextra-modules ------------------------------------------------------------------------------ diff --git a/src/site/en/apt/index.apt b/src/site/en/apt/history.apt similarity index 82% copy from src/site/en/apt/index.apt copy to src/site/en/apt/history.apt index 3e3d659..f31b7f2 100644 --- a/src/site/en/apt/index.apt +++ b/src/site/en/apt/history.apt @@ -1,60 +1,3 @@ -~~~ -~~ #%L -~~ I18n -~~ -~~ $Id$ -~~ $HeadURL$ -~~ %% -~~ Copyright (C) 2008 - 2010 CodeLutin -~~ %% -~~ This program is free software: you can redistribute it and/or modify -~~ it under the terms of the GNU Lesser General Public License as -~~ published by the Free Software Foundation, either version 3 of the -~~ License, or (at your option) any later version. -~~ -~~ This program is distributed in the hope that it will be useful, -~~ but WITHOUT ANY WARRANTY; without even the implied warranty of -~~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -~~ GNU General Lesser Public License for more details. -~~ -~~ You should have received a copy of the GNU General Lesser Public -~~ License along with this program. If not, see -~~ <http://www.gnu.org/licenses/lgpl-3.0.html>. -~~ #L% -~~~ - - --- -Nuiton I18n - --- - -Nuiton I18n - - Nuiton I18n project features Java classes for applications - internationalisation (i18n). - - This light library combine Java ResourceBundles, a powerful and easy to use - API and a really useful extension process. Lots of avantages comes with Nuiton - I18n use : - - - translation keys extraction - - - build process integration through Maven or Ant - - Here is a small example that shows Nuiton I18n usage simplicity : - ------------------------------------------------------------------------------ -I18n.init(new DefaultI18nInitializer("myBundle"), Locale.FR); -System.out.println(I18n._("This text will be translated")); ------------------------------------------------------------------------------ - - Have a look to the tutorials to see how to enrich your application with Nuiton - I18n. - - The two Nuiton I18n project modules : - - - {{{./nuiton-i18n/index.html}I18n Api}} - - - {{{./maven-i18n-plugin/index.html}I18n Maven Plugin}} What's new in 3.0 version @@ -130,7 +73,7 @@ What's new in 2.4 version Note that at runtime time translations can not be swapped froma syntax to another one, using a different syntax from the one used by translations will - not work properly. + not work properly. What's new in 2.3 version diff --git a/src/site/en/apt/index.apt b/src/site/en/apt/index.apt index 3e3d659..d868564 100644 --- a/src/site/en/apt/index.apt +++ b/src/site/en/apt/index.apt @@ -55,214 +55,3 @@ System.out.println(I18n._("This text will be translated")); - {{{./nuiton-i18n/index.html}I18n Api}} - {{{./maven-i18n-plugin/index.html}I18n Maven Plugin}} - -What's new in 3.0 version - -* Compatibility 1.8 - - To be compatible with java 1.8, some methods of the class <I18n> were renamed ({{{./migrate.html}Migration guide}}). - -* Remove some deprecated mojos - - Mojo jsp and tapestry were removed. - -What's new in 2.5 version - -* Plugin was renamed to i18n-maven-plugin. - - the plugin was renamed from <maven-i18n-plugin> to <i18n-maven-plugin>. - - think to update your poms. - -* Add a struts2 jsp parser - - this new parseur scan jsp files to extract keys which match these forms: - text name='xxx' or label='xxx' or %\{getText("xxx". - - Unfortunatly, we can't do better than this, and still we detects too much keys. - To avoid this problem we had a new paramter (see next section) to restrict - accepted incoming keys. - - anyway, always keep in mind that a good pratice is to use a common i18n - prefix for all your keys, so the pattern should not be so harde to write ;) - -* Add a new parameter <acceptKeyFormat> on parser-like goals - - This permits to limit incoming keys by a regex. - -* Can generate a csv file from the generated bundle for all locales. - - This can help people to translate missing keys. - - To use this just add *-Di18n.generateCsvFile* on the bundle mojo. - - See {{{http://nuiton.org/issues/2291}Evolution #2291: Generate a csv file with all translations for all locales in a csv file in bundle mojo}}. - -What's new in 2.4 version - -* Better usage of encodings - - Since JDK 1.6, it is possible to load and store properties files using a - given encoding, there is then no more reason to stay on a hardcoded encoding - such as <ISO-8859-1> or <US/ASCII>. - - I18n integrates this changes and now it is more serious to use as default - encoding <<UTF-8>>. - - This encoding can be changed at two places: - - - while generating files (by the i18n plugin) - - at the runtime initialization of I18n class via the initializer ({{{./nuiton-i18n/apidocs/org/nuiton/i18n/init/I18nInitializer.html}I18nInitializer}}). - -* Deal other syntax formats for translations - - By default, I18n use the <String.format> syntax for translations. - - By sometimes, we would like to use the i18n plugin to manage translations and - their bundles, but use a different i18n runtime system base on <MessageFormat> - (like does struts2 or GWT). - - Version 2.4 allows now to change the syntax of translations at differents places: - - - at generation time of the bundle using parameter <<bundleFormatConverter>> of <<bundle>> mojo. - - at runtime time, by giving to the i18n initializer the correct messageFormatter to use. - (see contract {{{./nuiton-i18n/apidocs/org/nuiton/i18n/I18nMessageFormatter.html}I18nMessageFormatter}}). - - Note that at runtime time translations can not be swapped froma syntax to - another one, using a different syntax from the one used by translations will - not work properly. - -What's new in 2.3 version - - Version 2.3 improves a lot performance on detection of java file i18n keys - (mojo <<parserJava>>). - - See {{{http://nuiton.org/issues/show/1275}Evolution #1275: Improve parserJava performance}}. - - We are now having some nice times (under 5 millisecondes for a file!) as - shown below : - --------------------------------------------------------------------------------- -mvn package -Pnotests -Di18n.strictMode -DnuitonI18nVersion=2.2 - -[INFO] --- maven-i18n-plugin:2.2:parserJava (default) @ observe-business --- -[INFO] Parsing is done. [treated file(s) : 76/187](total time:19.852s) ( ~ 106.158ms / file) -[INFO] --- maven-i18n-plugin:2.2:parserJava (scan-sources) @ observe-swing --- -[INFO] Parsing is done. [treated file(s) : 151/206](total time:38.732s) ( ~ 188.021ms / file) - -mvn package -Pnotests -Di18n.strictMode -DnuitonI18nVersion=2.3-SNAPSHOT - -[INFO] --- maven-i18n-plugin:2.3-SNAPSHOT:parserJava (default) @ observe-business --- -[INFO] Parsing is done. [treated file(s) : 76/187](total time:640.602ms) ( ~ 3.426ms / file) -[INFO] --- maven-i18n-plugin:2.3-SNAPSHOT:parserJava (scan-sources) @ observe-swing --- -[INFO] Parsing is done. [treated file(s) : 151/206](total time:450.823ms) ( ~ 2.188ms / file) --------------------------------------------------------------------------------- - -What's new in 2.2 version - - Version 2.2 just suppress the two depreciated methods in 2.1 version : - --------------------------------------------------------------------------------- -I18n._(String) -I18n.n_(String) --------------------------------------------------------------------------------- - - We strongly suggest you to use directly this new version and not the 2.1 - version to avoid some possible problems later (for example if a higer library or - application use the version 2.2... Some linkage error will appear). - -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. - - A <<parserTapestry>> and <<parserGWTJava>> have been introduced. The GWT parser gathers - all the keys identified by the annotation @Key. Coupling it with the XML Parser - 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>) - are compatible with the <ResourceBundle> Java API, meaning that we replaced - all <<->> by <<_>>. - - Before we had - ------------------------------------------------------------------------------ -mylib-fr_FR.properties ------------------------------------------------------------------------------ - - And now it is : - ------------------------------------------------------------------------------ -mylib_fr_FR.properties ------------------------------------------------------------------------------ - - * Migration to 2.0 version - - To use the 2.0 version, you first need to rename in your project the bundles - with the new names (or they will be generated at first execution and you will - be good for a copy/paste party. And anyway, it is best to rename existing - files to keep the history in your version control system). - - For the <<bundle>> mode (bundle mojo), no modification is necessary and it - will be compatible with libraries package with older i18n versions (1.x). - - * Add a JSP parser - - A new JSP parserhas been introduced to integrate the i18n detection system in - web developmments (using Struts for example). - - Take a look to the tutorials to see how to enhance your application using - Nuiton I18n. - - * Improve XML parsers - - The xml type parsers (at the moment we had only <<parserValidation>>) have - seen their design improved. Some parameters have become common to all parsers. - See the goal detail page to see what changed. - - We introduced the new <<parserXml>> that contains no key detection rules, the - user have to specify them by himself; this new mojo can allow key detection - in xml files not managed by the project. - - * Suppression of the <<I18n ant tasks>> module - - This module is not maintained for a long time, so it has been unactivated in - the default build. but it is still in the project and can be activated in a - profile named <<ant-task-profile>>. - - So to build the I18n project with this module, you just have to launch : - ------------------------------------------------------------------------------ -mvn install -Pextra-modules ------------------------------------------------------------------------------ diff --git a/src/site/site_en.xml b/src/site/site_en.xml index 7239cb7..718af7f 100644 --- a/src/site/site_en.xml +++ b/src/site/site_en.xml @@ -61,7 +61,7 @@ <poweredBy> <logo href="http://maven.apache.org" name="Maven" - img="${project.url}/images/logos/maven-feather.png"/> + img="${siteCommonResourcesUrl}/images/logos/maven-feather.png"/> </poweredBy> <body> @@ -84,7 +84,7 @@ </menu> <links> - <item name="nuiton.org" href="https://nuiton.org"/> + <item name="nuiton.org" href="https://forge.nuiton.org"/> <item name="CodeLutin" href="http://codelutin.com"/> <item name="Libre-Entreprise" href="http://www.libre-entreprise.org/"/> <!--item name="[fr" href="../index.html" /> @@ -92,8 +92,8 @@ </links> <menu name="User"> - <item name="Home" href="index.html"/> <item name="Presentation" href="presentation.html"/> + <item name="History" href="history.html"/> <item name="Migrate" href="migrate.html"/> <item name="Best Practices" href="bestPractices.html"/> <item name="Use with GWT" href="gwt.html"/> diff --git a/src/site/site_fr.xml b/src/site/site_fr.xml index d00eb8b..f0c0e08 100644 --- a/src/site/site_fr.xml +++ b/src/site/site_fr.xml @@ -90,8 +90,8 @@ </menu> <menu name="Utilisateur"> - <item name="Accueil" href="index.html"/> <item name="Présentation" href="presentation.html"/> + <item name="Historique" href="history.html"/> <item name="Migration" href="migrate.html"/> <item name="Best Practices" href="bestPractices.html"/> <item name="Utilisation avec GWT" href="gwt.html"/> -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.