|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.i2p.util.Translate
net.i2p.router.web.Messages
public class Messages
Translate strings for this package.
Field Summary | |
---|---|
(package private) static String |
COUNTRY_BUNDLE_NAME
|
Fields inherited from class net.i2p.util.Translate |
---|
PROP_COUNTRY, PROP_LANG |
Constructor Summary | |
---|---|
Messages()
|
Method Summary | |
---|---|
static String |
getDisplayLanguage(String langCode,
String dflt,
I2PAppContext ctx)
Return the "display language", e.g. |
static String |
getString(int n,
String s,
String p,
I2PAppContext ctx)
translate (ngettext) @since 0.7.14 |
static String |
getString(String key,
I2PAppContext ctx)
lang in routerconsole.lang property, else current locale |
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. |
static String |
getString(String s,
Object o,
Object o2,
I2PAppContext ctx)
two params @since 0.7.14 |
Methods inherited from class net.i2p.util.Translate |
---|
clearCache, getCountry, getDisplayLanguage, getLanguage, getString, getString, getString, getString, getString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
static final String COUNTRY_BUNDLE_NAME
Constructor Detail |
---|
public Messages()
Method Detail |
---|
public static String getString(String key, I2PAppContext ctx)
public static String getString(String s, Object o, I2PAppContext ctx)
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 tranlslate parameter also, use _("foo {0} bar", _("baz"))
Do not double the single quotes in the parameter.
Use autoboxing to call with ints, longs, floats, etc.public static String getString(String s, Object o, Object o2, I2PAppContext ctx)
public static String getString(int n, String s, String p, I2PAppContext ctx)
public static String getDisplayLanguage(String langCode, String dflt, I2PAppContext ctx)
langCode
- two-letter lower-casedflt
- e.g. "English"
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |