/** * Returns the value of the parameter for the language (if present and the * langage is active). This merges language specific parameters with * default parameters. * @param language the language * @param paramName the name of the param * @return the param or <code>null</code> if not present OR the language * is not active. */ public String getParameter(String language, String paramName) { Map<String,String> params = getParameters(language); int countrySepPos = language == null ? -1 : language.indexOf('-'); //we need to fallback to the language specific config if // * there is a country code // * no country specific params OR // * param not present in country specific config if(countrySepPos >= 2 && (params == null || !params.containsKey(paramName))) { params = getParameters(language.substring(0,countrySepPos)); } return params == null ? null : params.get(paramName); }
/** * Returns the value of the parameter for the language (if present and the * langage is active). This merges language specific parameters with * default parameters. * @param language the language * @param paramName the name of the param * @return the param or <code>null</code> if not present OR the language * is not active. */ public String getParameter(String language, String paramName) { Map<String,String> params = getParameters(language); int countrySepPos = language == null ? -1 : language.indexOf('-'); //we need to fallback to the language specific config if // * there is a country code // * no country specific params OR // * param not present in country specific config if(countrySepPos >= 2 && (params == null || !params.containsKey(paramName))) { params = getParameters(language.substring(0,countrySepPos)); } return params == null ? null : params.get(paramName); }
Map<String,String> config = fstConfig.getParameters(language); String langIndexField = config.get(IndexConfiguration.PARAM_FIELD); String langStoreField = config.get(IndexConfiguration.PARAM_STORE_FIELD);
applyLanguageParameter(lpc, lang, tpc.languages.getParameters(lang)); tpc.languageConfigs.put(lang, lpc);
applyLanguageParameter(lpc, lang, tpc.languages.getParameters(lang)); tpc.languageConfigs.put(lang, lpc);