Index: maven-commandline-plugin/src/java/org/codelutin/option/generate/RstGeneratorGoal.java diff -u maven-commandline-plugin/src/java/org/codelutin/option/generate/RstGeneratorGoal.java:1.15 maven-commandline-plugin/src/java/org/codelutin/option/generate/RstGeneratorGoal.java:1.16 --- maven-commandline-plugin/src/java/org/codelutin/option/generate/RstGeneratorGoal.java:1.15 Sun Mar 23 01:27:19 2008 +++ maven-commandline-plugin/src/java/org/codelutin/option/generate/RstGeneratorGoal.java Sun Mar 23 06:05:18 2008 @@ -21,7 +21,6 @@ import org.codelutin.i18n.I18n; import static org.codelutin.i18n.I18n._; import org.codelutin.i18n.I18nLoader; -import org.codelutin.i18n.LanguageManager; import org.codelutin.i18n.bundle.I18nBundleManager; import org.codelutin.option.ConfigKey; import org.codelutin.option.ConfigPropertyKey; @@ -89,9 +88,9 @@ // find bundles for the project URL[] urls = Resource.getURLs(I18nBundleManager.SEARCH_BUNDLE_PATTERN, getI18nCP().toURI().toURL()).toArray(new URL[2]); - // reset i18n manager - LanguageManager.reset(); - + // set extra urls (will reset i18n manager) + I18n.setExtraURL(urls); + for (String bundle : getBundles()) { String pattern = getContext().getRstFilePath(); @@ -99,16 +98,16 @@ Writer w = null; try { - Locale langue = I18nLoader.newLocale(bundle); + Locale locale = I18nLoader.newLocale(bundle); - File rstFilePath = new File(pattern.replace("@bundle@", langue.getLanguage()) + File.separator + filename); + File rstFilePath = new File(pattern.replace("@bundle@", locale.getLanguage()) + File.separator + filename); if (!rstFilePath.getParentFile().exists()) { rstFilePath.getParentFile().mkdirs(); } w = new BufferedWriter(new FileWriter(rstFilePath)); - generateForBundle(w, rstFilePath, getPrefix(), optionKeys, configKeys, langue, urls); + generateForBundle(w, rstFilePath, getPrefix(), optionKeys, configKeys, locale); } finally { if (w != null) { w.flush(); @@ -118,10 +117,10 @@ } } - private void generateForBundle(Writer w, File rstFilePath, String prefix, List optionKeys, List configKeys, Locale langue, URL[] urls) throws IOException { - - // init i18n with this - I18n.init(langue, getEncoding(), urls); + private void generateForBundle(Writer w, File rstFilePath, String prefix, List optionKeys, List configKeys, Locale locale) throws IOException { + + // init i18n with this locale + I18n.init(locale, getEncoding()); toString(w, _("commandline.generateRstFile.head", prefix),