Package net.i2p.router.web
Class Messages
java.lang.Object
net.i2p.util.Translate
net.i2p.router.web.Messages
Translate strings for this package.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final String[][]Each language has the ISO code, the flag, the name, and the optional country name.Fields inherited from class net.i2p.util.Translate
PROP_COUNTRY, PROP_LANG -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetDisplayLanguage(String langCode, String dflt, I2PAppContext ctx) Return the "display language", e.g.static StringgetString(int n, String s, String p, I2PAppContext ctx) translate (ngettext) @since 0.7.14static StringgetString(String s, Object o, Object o2, I2PAppContext ctx) two params @since 0.7.14static StringgetString(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.static StringgetString(String key, I2PAppContext ctx) lang in routerconsole.lang property, else current localeMethods inherited from class net.i2p.util.Translate
clearCache, getCountry, getDisplayLanguage, getLanguage, getString, getString, getString, getString, getString, isRTL, isRTL, setLanguage
-
Field Details
-
COUNTRY_BUNDLE_NAME
- Since:
- public since 0.9.33, was package private
- See Also:
-
LANGS
Each language has the ISO code, the flag, the name, and the optional country name. Alphabetical by the ISO code please. See http://en.wikipedia.org/wiki/ISO_639-1 . Any language-specific flag added to the icon set must be added to the top-level build.xml for the updater. As of 0.9.12, ISO 639-2 three-letter codes are supported also. Note: To avoid truncation, ensure language name is no longer than 17 chars.- Since:
- 0.9.69 moved from ConfigUIHelper for TranslationStatus only, not for external use
-
-
Constructor Details
-
Messages
public Messages()
-
-
Method Details
-
getString
lang in routerconsole.lang property, else current locale -
getString
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.
-
getString
two params @since 0.7.14 -
getString
translate (ngettext) @since 0.7.14 -
getDisplayLanguage
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-casedflt- e.g. "English"- Since:
- 0.9.5
-