r1921 - in trunk/maven-i18n-plugin/src: it/evo-1507 it/evo-1507/src/test/java/org/nuiton/i18n it/evo-1507/src/test/resources main/java/org/nuiton/i18n/plugin/bundle
Author: tchemit Date: 2011-05-11 16:48:59 +0200 (Wed, 11 May 2011) New Revision: 1921 Url: http://nuiton.org/repositories/revision/i18n/1921 Log: clean javadoc and it Modified: trunk/maven-i18n-plugin/src/it/evo-1507/invoker.properties trunk/maven-i18n-plugin/src/it/evo-1507/pom.xml trunk/maven-i18n-plugin/src/it/evo-1507/src/test/java/org/nuiton/i18n/ReadMessageFormatTest.java trunk/maven-i18n-plugin/src/it/evo-1507/src/test/resources/log4j.properties trunk/maven-i18n-plugin/src/main/java/org/nuiton/i18n/plugin/bundle/BundleFormatConverter.java trunk/maven-i18n-plugin/src/main/java/org/nuiton/i18n/plugin/bundle/StringFormatToMessageFormatConverter.java Modified: trunk/maven-i18n-plugin/src/it/evo-1507/invoker.properties =================================================================== --- trunk/maven-i18n-plugin/src/it/evo-1507/invoker.properties 2011-05-10 22:16:27 UTC (rev 1920) +++ trunk/maven-i18n-plugin/src/it/evo-1507/invoker.properties 2011-05-11 14:48:59 UTC (rev 1921) @@ -24,7 +24,7 @@ ### # A comma or space separated list of goals/phases to execute, may # specify an empty list to execute the default goal of the IT project -invoker.goals=clean test i18n:available-converters +invoker.goals=clean test # Optionally, a list of goals to run during further invocations of Maven #invoker.goals.2=${project.groupId}:${project.artifactId}:${project.version}:run Modified: trunk/maven-i18n-plugin/src/it/evo-1507/pom.xml =================================================================== --- trunk/maven-i18n-plugin/src/it/evo-1507/pom.xml 2011-05-10 22:16:27 UTC (rev 1920) +++ trunk/maven-i18n-plugin/src/it/evo-1507/pom.xml 2011-05-11 14:48:59 UTC (rev 1921) @@ -41,9 +41,9 @@ </parent> <groupId>org.nuiton.i18n</groupId> - <artifactId>evo-formatter</artifactId> + <artifactId>evo-1507</artifactId> - <name>I18n Test :: evo-formatter</name> + <name>I18n Test :: evo-1507</name> <dependencies> @@ -78,7 +78,6 @@ <verbose>true</verbose> <bundleFormatConverter>toMessageFormat</bundleFormatConverter> <bundleOutputName>ResultBundle</bundleOutputName> - <bundleOutputPackage>org.nuiton</bundleOutputPackage> </configuration> <executions> <execution> Modified: trunk/maven-i18n-plugin/src/it/evo-1507/src/test/java/org/nuiton/i18n/ReadMessageFormatTest.java =================================================================== --- trunk/maven-i18n-plugin/src/it/evo-1507/src/test/java/org/nuiton/i18n/ReadMessageFormatTest.java 2011-05-10 22:16:27 UTC (rev 1920) +++ trunk/maven-i18n-plugin/src/it/evo-1507/src/test/java/org/nuiton/i18n/ReadMessageFormatTest.java 2011-05-11 14:48:59 UTC (rev 1921) @@ -28,6 +28,7 @@ import org.junit.Assert; import org.junit.Test; import org.nuiton.i18n.init.DefaultI18nInitializer; +import org.nuiton.i18n.init.I18nInitializer; import java.util.Locale; @@ -42,19 +43,18 @@ @After public void tearDown() { I18n.close(); - I18n.setFormatter(I18nFormat.STRING_FORMAT); } @Test public void testMessageFormatFormatter() { - DefaultI18nInitializer initializer = - new DefaultI18nInitializer("ResultBundle", null, "org/nuiton/"); + I18nInitializer initializer = new DefaultI18nInitializer("ResultBundle"); + initializer.setMessageFormatter( + new I18nUtil.MessageFormatI18nMessageFormatter()); + I18n.init(initializer, Locale.FRANCE); - I18n.setFormatter(I18nFormat.MESSAGE_FORMAT); - String expected = "Message qui fait attention à la conversion de param"; String actual = I18n._("lib.property.message2", "param"); Assert.assertEquals(expected, actual); Modified: trunk/maven-i18n-plugin/src/it/evo-1507/src/test/resources/log4j.properties =================================================================== --- trunk/maven-i18n-plugin/src/it/evo-1507/src/test/resources/log4j.properties 2011-05-10 22:16:27 UTC (rev 1920) +++ trunk/maven-i18n-plugin/src/it/evo-1507/src/test/resources/log4j.properties 2011-05-11 14:48:59 UTC (rev 1921) @@ -30,5 +30,4 @@ log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) %M - %m%n # package level -log4j.logger.org.nuiton.util=WARN -log4j.logger.org.nuiton.i18n=DEBUG +log4j.logger.org.nuiton=WARN Modified: trunk/maven-i18n-plugin/src/main/java/org/nuiton/i18n/plugin/bundle/BundleFormatConverter.java =================================================================== --- trunk/maven-i18n-plugin/src/main/java/org/nuiton/i18n/plugin/bundle/BundleFormatConverter.java 2011-05-10 22:16:27 UTC (rev 1920) +++ trunk/maven-i18n-plugin/src/main/java/org/nuiton/i18n/plugin/bundle/BundleFormatConverter.java 2011-05-11 14:48:59 UTC (rev 1921) @@ -24,11 +24,10 @@ */ package org.nuiton.i18n.plugin.bundle; -import org.nuiton.i18n.I18nFormatter; - /** - * Used to convert from a {@link I18nFormatter} syntax to an other. + * Contract to make a conversion from a syntax to another one. * <p/> + * <p/> * Created: 05/05/11 * * @author fdesbois <desbois@codelutin.com> @@ -40,7 +39,7 @@ /** * Convert format syntax to an other from {@code value}. * - * @param value Message with some format placeholders to convert + * @param value message with some format placeholders to convert * @return the message with other format syntax */ String convert(String value); Modified: trunk/maven-i18n-plugin/src/main/java/org/nuiton/i18n/plugin/bundle/StringFormatToMessageFormatConverter.java =================================================================== --- trunk/maven-i18n-plugin/src/main/java/org/nuiton/i18n/plugin/bundle/StringFormatToMessageFormatConverter.java 2011-05-10 22:16:27 UTC (rev 1920) +++ trunk/maven-i18n-plugin/src/main/java/org/nuiton/i18n/plugin/bundle/StringFormatToMessageFormatConverter.java 2011-05-11 14:48:59 UTC (rev 1921) @@ -29,11 +29,13 @@ import org.apache.commons.logging.LogFactory; import java.text.MessageFormat; +import java.util.Formatter; import java.util.regex.Matcher; import java.util.regex.Pattern; /** - * Converter used to change printf args syntax by {@link MessageFormat} syntax. + * Implementation of {@link BundleFormatConverter} to convert {@link Formatter} + * syntax to a {@link MessageFormat} syntax. * <p/> * Created: 05/05/11 *
participants (1)
-
tchemit@users.nuiton.org