/** * Sets the locale. * * @param code the locale ISO language code * @throws IzPackException if the locale isn't supported */ public void setLocale(String code) { Locales locales = getComponent(Locales.class); locales.setLocale(code); }
/** * Sets the selected locale on the installation data. * * @param code the locale ISO code */ public void propagateLocale(String code) { try { locales.setLocale(code); Locale newLocale = locales.getLocale(); Locale.setDefault(newLocale); installData.setLocale(locales.getLocale(), locales.getISOCode()); installData.setMessages(locales.getMessages()); AbstractInstallDataProvider.addCustomLangpack(installData, locales); } catch (Exception exception) { logger.log(Level.SEVERE, exception.getMessage(), exception); } } }
/** * Sets the selected locale on the installation data. * * @param code the locale ISO code */ public void propagateLocale(String code) { try { locales.setLocale(code); Locale newLocale = locales.getLocale(); Locale.setDefault(newLocale); JComponent.setDefaultLocale(newLocale); SwingUtilities.updateComponentTreeUI(this); installData.setLocale(locales.getLocale(), locales.getISOCode()); installData.setMessages(locales.getMessages()); AbstractInstallDataProvider.addCustomLangpack(installData, locales); // Configure buttons after locale has been loaded installData.configureGuiButtons(); } catch (Exception exception) { logger.log(Level.SEVERE, exception.getMessage(), exception); } }
installData.setInstallationRecord(installRecord); String code = installRecord.getAttribute("langpack", "eng"); locales.setLocale(code);