Package com.axelor.i18n
Class I18n
java.lang.Object
com.axelor.i18n.I18n
This class provider methods for internationalization (I18n) services.
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
Return the localized translation of the given message, based on the current language.static String
Similar to theget(String)
but considers plural form based on the given number value.static ResourceBundle
Get the resource bundle for the currentLocale
.static ResourceBundle
Get a resource bundle for the given locale.
-
Method Details
-
getBundle
Get a resource bundle for the given locale.- Parameters:
locale
- the locale for which a resource bundle is desired- Returns:
- an instance of
I18nBundle
-
getBundle
Get the resource bundle for the currentLocale
.- Returns:
- an instance of
I18nBundle
-
get
Return the localized translation of the given message, based on the current language.- Parameters:
message
- the original message to be translated- Returns:
- the localized message or the message itself if not found.
-
get
Similar to theget(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));
- Parameters:
singular
- the singular form of the original messageplural
- the plural form of the original messagenumber
- the value to decide plurality- Returns:
- the localized singular or plural message or the original message itself if not found.
-