Class Messages


  • public class Messages
    extends Translate
    Translate strings for this package.
    • Field Detail

      • COUNTRY_BUNDLE_NAME

        public static final String COUNTRY_BUNDLE_NAME
        Since:
        public since 0.9.33, was package private
        See Also:
        Constant Field Values
    • Constructor Detail

      • Messages

        public Messages()
    • Method Detail

      • getString

        public static String getString​(String key,
                                       I2PAppContext ctx)
        lang in routerconsole.lang property, else current locale
      • getString

        public static String getString​(String s,
                                       Object o,
                                       I2PAppContext ctx)
        translate a string with a parameter This is a lot more expensive than getString(s, ctx), so use sparingly.
        Parameters:
        s - string to be translated containing {0} The {0} will be replaced by the parameter. Single quotes must be doubled, i.e. ' -> '' in the string.
        o - parameter, not translated. To translate parameter also, use _t("foo {0} bar", _t("baz")) Do not double the single quotes in the parameter. Use autoboxing to call with ints, longs, floats, etc.
      • getDisplayLanguage

        public static String getDisplayLanguage​(String langCode,
                                                String dflt,
                                                I2PAppContext ctx)
        Return the "display language", e.g. "English" for the language specified by langCode, using the current language. Uses translation if available, then JVM Locale.getDisplayLanguage() if available, else default param.
        Parameters:
        langCode - two-letter lower-case
        dflt - e.g. "English"
        Since:
        0.9.5