java.lang.Object
net.i2p.i2ptunnel.ui.Messages
Translate strings for this package. This is for the strings in the UI. Bundles are in the war. Note that there are separate bundles for the proxy error messages in the jar, which are not accessed by this class.
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final I2PAppContextSupplies the locale the translated strings are looked up in.private static final StringThe bundle holding the tunnel manager's translated stringsConstructor Summary
ConstructorsMethod Summary
Modifier and TypeMethodDescriptionLang inrouterconsole.langproperty, else current locale.Translate a string with a parameter This is a lot more expensive than getString(s, ctx), so use sparingly.Translate a string with two parameters.static String_t(String key, I2PAppContext ctx) Static translation method.translate (ngettext).static Stringngettext(String s, String p, int n, I2PAppContext ctx) translate (ngettext).
Field Details
BUNDLE_NAME
The bundle holding the tunnel manager's translated strings- See Also:
_context
Supplies the locale the translated strings are looked up in.
Constructor Details
Messages
public Messages()Create a messages instance using the global context.
Method Details
_t
_t
Static translation method.- Parameters:
key- the translation keyctx- the I2P app context- Returns:
- the translated string
_t
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.- Returns:
- the translated string
_t
ngettext
translate (ngettext).- Parameters:
s- the singular formp- the plural formn- the count for pluralizationctx- the I2P app context- Returns:
- the translated string
ngettext