public final class I18n extends Object
Modifier and Type | Method and Description |
---|---|
static String |
get(String message)
Return the localized translation of the given message, based on the
current language.
|
static String |
get(String singular,
String plural,
int number)
Similar to the
get(String) but considers plural form based on
the given number value. |
static ResourceBundle |
getBundle()
Get the resource bundle for the current
Locale . |
static ResourceBundle |
getBundle(Locale locale)
Get a resource bundle for the given locale.
|
public static ResourceBundle getBundle(Locale locale)
locale
- the locale for which a resource bundle is desiredI18nBundle
public static ResourceBundle getBundle()
Locale
.I18nBundle
public static String get(String message)
message
- the original message to be translatedpublic static String get(String singular, String plural, int number)
get(String)
but considers plural form based on
the given number value.
assertEquals("1 record selected.", I18n.get("{0} record selected.", "{0} records selected.", 1)); assertEquals("5 records selected.", I18n.get("{0} record selected.", "{0} records selected.", 5));
singular
- the singular form of the original messageplural
- the plural form of the original messagenumber
- the value to decide plurality