public float getFloat(String key, String languageId) { float value = 0; try { Language lang = langAPI.getLanguage(languageId); value = langAPI.getFloatKey(lang, key); } catch (Exception e) { Logger.error(this, e.toString()); } return value; }
public boolean getBoolean(String key, String languageId) { boolean value = false; try { Language lang = langAPI.getLanguage(languageId); value = langAPI.getBooleanKey(lang, key); } catch (Exception e) { Logger.error(this, e.toString()); } return value; }
public String get(String key, String languageId) { String value = null; try { Language lang = langAPI.getLanguage(languageId); value = langAPI.getStringKey(lang, key); if ((!UtilMethods.isSet(value) || value.equals(key)) && Config.getBooleanProperty("DEFAULT_CONTENT_TO_DEFAULT_LANGUAGE")) { lang = langAPI.getDefaultLanguage(); value = langAPI.getStringKey(lang, key); } } catch (Exception e) { Logger.error(this, e.toString()); } return (value == null) ? "" : value; }
/** * Get Language by language code * * @param langId * @return Language */ public static Language getLanguage(String langId) { return langAPI.getLanguage(langId); }
/** * Get Language by language code and country code * * @param languageCode * @param countryCode * @return Language */ public static Language getLanguage(String languageCode, String countryCode) { return langAPI.getLanguage(languageCode, countryCode); }