/** * Configures the LocalizationManager's locale, which is used when reporting compile time errors, warnings, and * info. * * @param toolsLocale A locale in Java format. For example, "en" or "ja_JP". * @throws ConfigurationException When the specified toolsLocale is not available a ToolsLocaleNotAvailable error is * reported. */ @Config @Mapping("tools-locale") public void setToolsLocale(ConfigurationValue cv, String toolsLocale) throws ConfigurationException { Locale[] locales = Locale.getAvailableLocales(); for (int i = 0; i < locales.length; i++) { if (locales[i].toString().equals(toolsLocale)) { this.toolsLocale = locales[i]; LocalizationManager.get().setLocale(locales[i]); return; } } throw new ConfigurationException.ToolsLocaleNotAvailable(cv.getVar(), cv.getSource(), cv.getLine()); }
/** * Configures the LocalizationManager's locale, which is used when reporting compile time errors, warnings, and * info. * * @param toolsLocale A locale in Java format. For example, "en" or "ja_JP". * @throws ConfigurationException When the specified toolsLocale is not available a ToolsLocaleNotAvailable error is * reported. */ @Config @Mapping("tools-locale") public void setToolsLocale(ConfigurationValue cv, String toolsLocale) throws ConfigurationException { Locale[] locales = Locale.getAvailableLocales(); for (int i = 0; i < locales.length; i++) { if (locales[i].toString().equals(toolsLocale)) { this.toolsLocale = locales[i]; LocalizationManager.get().setLocale(locales[i]); return; } } throw new ConfigurationException.ToolsLocaleNotAvailable(cv.getVar(), cv.getSource(), cv.getLine()); }