public String getLocalizedTextString( Object object ) { String s = getLocalizedTextString(locale, object ); return s; }
public String getLocalizedTextString( Locale locale, String id, Map 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 ); }
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; }
public String format( Map parameters ) { return LocalizationManager.replaceInlineReferences( text, parameters ); } private String text;
getLocalizationManager().setLocale(LocaleUtils.toLocale(args[++i]));
public String format( Map parameters ) { return LocalizationManager.replaceInlineReferences( text, parameters ); } private String text;
public String getLocalizedTextString( Object object ) { String s = getLocalizedTextString(locale, object ); return s; }
public String format( Map parameters ) { StringBuilder buffer = new StringBuilder(); String s = node.execute( buffer, node.locale, parameters )? buffer.toString() : null; if (s != null) { s = LocalizationManager.replaceInlineReferences( s, parameters ); } return s; } private XLRTargetNode node;
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; }
public String getLocalizedTextString( Locale locale, String id, Map 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 ); }
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 format( Map parameters ) { StringBuilder buffer = new StringBuilder(); String s = node.execute( buffer, node.locale, parameters )? buffer.toString() : null; if (s != null) { s = LocalizationManager.replaceInlineReferences( s, parameters ); } return s; } private XLRTargetNode node;
public String getLocalizedTextString( String id, Map parameters ) { return getLocalizedTextString(locale, id, parameters ); }
public String getLocalizedTextString( String id ) { return getLocalizedTextString( id, Collections.EMPTY_MAP ); }
public String getLocalizedTextString( String id ) { return getLocalizedTextString( id, Collections.EMPTY_MAP ); }
public String getLocalizedTextString( String id, Map parameters ) { return getLocalizedTextString(locale, id, parameters ); }
public static String brief( String program, String defaultvar, LocalizationManager l10n, String l10nPrefix ) { Map<String, String> params = new HashMap<String, String>(); params.put( "defaultVar", defaultvar ); params.put( "program", program ); return l10n.getLocalizedTextString( l10nPrefix + ".Brief", params ); }
public static String getSyntaxDescription( String program, String defaultVar, boolean advanced, LocalizationManager l10n, String l10nPrefix ) { Map<String, String> params = new HashMap<String, String>(); params.put("defaultVar", defaultVar); params.put("program", program); String key = l10nPrefix + "." + (advanced? "AdvancedSyntax" : "Syntax"); String text = l10n.getLocalizedTextString( key, params ); if (text == null) { text = "No syntax help available, try '-help list' to list available configuration variables."; assert false : "Localized text for syntax description not found!"; } return text; }
private int parseLineNumber(String lineNumber) throws ParseException { try { return Integer.parseInt(lineNumber); } catch (NumberFormatException nfe) { Map<String, Object> args = new HashMap<String, Object>(); args.put("token", lineNumber); //$NON-NLS-1$ throw new ParseException(getLocalizationManager().getLocalizedTextString("expectedLineNumber", args), 0); //$NON-NLS-1$ } }
private int parseFileNumber(String fileNumber) throws ParseException { try { return Integer.parseInt(fileNumber); } catch (NumberFormatException nfe) { Map<String, Object> args = new HashMap<String, Object>(); args.put("token", fileNumber); //$NON-NLS-1$ throw new ParseException(getLocalizationManager().getLocalizedTextString("expectedFileNumber", args), 0); //$NON-NLS-1$ } }