public String getLocalizedTextString( Object object ) { String s = getLocalizedTextString(locale, object ); return s; }
@Override public String format( Map<String, Object> parameters ) { return LocalizationManager.replaceInlineReferences( text, parameters ); } private String text;
public String getLocalizedTextString( Locale locale, String id, Map<String, Object> parameters ) { ILocalizedText t = getLocalizedText( locale, id ); if ((t == null) && !locale.equals(locale)) { t = getLocalizedText(locale, id ); } if ((t == null) && !locale.getLanguage().equals( "en" )) { t = getLocalizedText( new Locale( "en" ), id ); } return (t == null)? null : t.format( parameters ); }
@Override public String getMessage() { String msg = super.getMessage(); if (msg != null && msg.length() > 0) { return msg; } else { return LocalizationManager.get().getLocalizedTextString(this); } }
private ILocalizedText getLocalizedText( Locale locale, String id ) { ILocalizedText t = getLocalizedTextInner( locale, id ); if ((t == null) && (locale.getCountry().length() > 0) && (locale.getVariant().length() > 0)) { t = getLocalizedTextInner( new Locale( locale.getLanguage(), locale.getCountry() ), id ); } if ((t == null) && (locale.getCountry().length() > 0)) { t = getLocalizedTextInner( new Locale( locale.getLanguage() ), id ); } return t; }
private ILocalizedText getLocalizedTextInner( Locale locale, String id ) { for (Iterator<ILocalizer> it = localizers.iterator(); it.hasNext(); ) { ILocalizer localizer = it.next(); ILocalizedText text = localizer.getLocalizedText( locale, id ); if (text != null) { return text; } } return null; }
@Override public String getMessage() { String msg = super.getMessage(); if (msg != null && msg.length() > 0) { return msg; } else { return LocalizationManager.get().getLocalizedTextString(this); } }
public static String getDescription(ConfigurationBuffer buffer, String var, LocalizationManager l10n, String l10nPrefix) { String key = (l10nPrefix == null) ? var : (l10nPrefix + "." + var); String description = l10n.getLocalizedTextString(key, null); return description; }
public String getLocalizedTextString( Locale locale, String id, Map<String, Object> parameters ) { ILocalizedText t = getLocalizedText( locale, id ); if ((t == null) && !locale.equals(locale)) { t = getLocalizedText(locale, id ); } if ((t == null) && !locale.getLanguage().equals( "en" )) { t = getLocalizedText( new Locale( "en" ), id ); } return (t == null)? null : t.format( parameters ); }
@Override public String format( Map<String, Object> parameters ) { return LocalizationManager.replaceInlineReferences( text, parameters ); } private String text;
private ILocalizedText getLocalizedText( Locale locale, String id ) { ILocalizedText t = getLocalizedTextInner( locale, id ); if ((t == null) && (locale.getCountry().length() > 0) && (locale.getVariant().length() > 0)) { t = getLocalizedTextInner( new Locale( locale.getLanguage(), locale.getCountry() ), id ); } if ((t == null) && (locale.getCountry().length() > 0)) { t = getLocalizedTextInner( new Locale( locale.getLanguage() ), id ); } return t; }
private ILocalizedText getLocalizedTextInner( Locale locale, String id ) { for (Iterator<ILocalizer> it = localizers.iterator(); it.hasNext(); ) { ILocalizer localizer = it.next(); ILocalizedText text = localizer.getLocalizedText( locale, id ); if (text != null) { return text; } } return null; }
public static String getDescription(ConfigurationBuffer buffer, String var, LocalizationManager l10n, String l10nPrefix) { String key = (l10nPrefix == null) ? var : (l10nPrefix + "." + var); String description = l10n.getLocalizedTextString(key, null); return description; }
public String getLocalizedTextString( Object object ) { String s = getLocalizedTextString(locale, object ); return s; }
public String getLocalizedTextString( String id, Map<String, Object> parameters ) { return getLocalizedTextString(locale, id, parameters ); }
public String getLocalizedTextString( String id, Map<String, Object> parameters ) { return getLocalizedTextString(locale, id, parameters ); }
public String getLocalizedTextString( String id ) { return getLocalizedTextString( id, Collections.<String, Object>emptyMap()); }
public String getLocalizedTextString( String id ) { return getLocalizedTextString( id, Collections.<String, Object>emptyMap()); }
public static String brief(String program, String defaultvar, LocalizationManager l10n, String l10nPrefix) { Map<String, Object> params = new HashMap<String, Object>(); params.put("defaultVar", defaultvar); params.put("program", program); return l10n.getLocalizedTextString(l10nPrefix + ".Brief", params); }
public static String brief(String program, String defaultvar, LocalizationManager l10n, String l10nPrefix) { Map<String, Object> params = new HashMap<String, Object>(); params.put("defaultVar", defaultvar); params.put("program", program); return l10n.getLocalizedTextString(l10nPrefix + ".Brief", params); }