private String getTranslation(String id) { return messages.get(id); }
/** * Creates a new messages instance from the named resource that inherits the current messages. * * @param name the messages resource name * @return the messages */ @Override public Messages newMessages(String name) { Messages child = locales.getMessages(name); Messages result = new LocaleDatabase(this, locales); result.add(child); return result; }
/** * Adds messages. * <p/> * This merges the supplied messages with the current messages. If an existing message exists with the same * identifier as that supplied, it will be replaced. * * @param messages the messages to add */ @Override public void add(Messages messages) { putAll(messages.getMessages()); }
if (installData.getMessages().getMessages().containsKey(searchkey)) retval = installData.getMessages().get(searchkey);
messages = installData.getMessages().newMessages(Resources.PACK_TRANSLATIONS_RESOURCE_NAME); out(Type.INFORMATION, installData.getMessages().get(DONE)); selectedPacks = packsModel.updatePacksToInstall();
/** * Returns the step name for a pack, for reporting purposes. * * @param pack the pack * @return the pack's step name */ protected String getStepName(Pack pack) { if (packMessages == null) { if (messages != null) { try { packMessages = messages.newMessages(Resources.PACK_TRANSLATIONS_RESOURCE_NAME); } catch (Exception ex) { logger.fine(ex.getLocalizedMessage()); } } } // hide pack name if it is hidden return pack.isHidden() ? "" : PackHelper.getPackName(pack, packMessages); }
public PacksConsolePanel(PanelView<ConsolePanel> panel, InstallData installData, Prompt prompt) { super(panel); this.prompt = prompt; this.installData = installData; //load the packs lang messages if exists try { messages = installData.getMessages().newMessages(Resources.PACK_TRANSLATIONS_RESOURCE_NAME); } catch (ResourceNotFoundException exception) { // no packs messages resource, so fall back to the default messages = installData.getMessages(); } }
/** * Returns a localised version of a string. * * @param value the string value * @return the localised version of {@code value}, or {@code value} if there is no localised version */ public String getLocalString(String value) { return messages.get(value); }
/** * Constructs a {@code UserInputPanelSpec}. * * @param resources the resources * @param installData the installation data * @param factory the factory * @param matcher the platform-model matcher */ public UserInputPanelSpec(Resources resources, InstallData installData, ObjectFactory factory, PlatformModelMatcher matcher) { Messages messages = installData.getMessages(); try { messages = messages.newMessages(LANG_FILE_NAME); } catch (ResourceNotFoundException exception) { logger.info(exception.getMessage()); } config = new Config(SPEC_FILE_NAME, resources, installData, factory, messages); this.installData = installData; this.matcher = matcher; }
if (installData.getMessages().getMessages().containsKey(searchkey))
/** * Add the contents of a custom langpack to the default langpack, if it exists. * * @param installData the install data to be used */ public static void addCustomLangpack(AutomatedInstallData installData, Locales locales) { // We try to load and add a custom langpack. try { installData.getMessages().add(locales.getMessages(Resources.CUSTOM_TRANSLATIONS_RESOURCE_NAME)); logger.fine("Found custom langpack for " + installData.getLocaleISO3()); } catch (ResourceNotFoundException exception) { logger.fine("No custom langpack for " + installData.getLocaleISO3() + " available"); } }
public String getDescription() { return messages.get("nextmedia.filedesc"); }
messages = messages.newMessages(Resources.PACK_TRANSLATIONS_RESOURCE_NAME);
if (getMetadata().hasPanelId() && installData.getMessages().getMessages().containsKey(searchkey)) if (installData.getMessages().getMessages().containsKey(searchkey))
messages = installData.getMessages().newMessages(Resources.PACK_TRANSLATIONS_RESOURCE_NAME);
private void logEpilog() { logger.info(messages.get("installer.finished")); }
public PacksModel(InstallData idata) { this.installData = idata; this.rules = idata.getRules(); try{ this.messages = idata.getMessages().newMessages(Resources.PACK_TRANSLATIONS_RESOURCE_NAME); } catch(ResourceNotFoundException ex){ this.messages=idata.getMessages(); } this.variables = idata.getVariables(); this.packsToInstall = idata.getSelectedPacks(); this.modifyInstallation = Boolean.valueOf(idata.getVariable(InstallData.MODIFY_INSTALLATION)); this.installedPacks = loadInstallationInformation(modifyInstallation); this.packs = getVisiblePacks(); this.hiddenPacks = getHiddenPacks(); this.nameToRow = getNametoRowMapping(packs); this.nameToPack = getNametoPackMapping(idata.getAvailablePacks()); this.packs = setPackProperties(packs, nameToPack); this.checkValues = initCheckValues(packs, packsToInstall); updateConditions(true); updatePacksToInstall(); }
public void configureGuiButtons() { Messages messages = getMessages(); UIManager.put("OptionPane.yesButtonText", messages.get("installer.yes")); UIManager.put("OptionPane.noButtonText", messages.get("installer.no")); UIManager.put("OptionPane.cancelButtonText", messages.get("installer.cancel")); UIManager.put("OptionPane.closeButtonText", messages.get("installer.close")); UIManager.put("OptionPane.showDetailsButtonText", messages.get("installer.showDetails")); UIManager.put("OptionPane.hideDetailsButtonText", messages.get("installer.hideDetails")); UIManager.put("OptionPane.copyButtonText", messages.get("installer.copy")); UIManager.put("OptionPane.sendReportButtonText", messages.get("installer.sendReport")); }
protected static String getString(AutomatedInstallData automatedInstallData, String key) { return automatedInstallData.getMessages().get(key); } }