Package org.openehr.utils.message
Class I18n
- java.lang.Object
-
- org.openehr.utils.message.I18n
-
public class I18n extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description I18n()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.LocalegetCurrentLocale()static java.lang.Stringregister(java.lang.String template)Register a template key and return it.static voidsetCurrentLocale(java.util.Locale locale)static java.lang.Stringt(java.lang.String input, java.lang.Object... args)Translate the given string with the given input to the desired languagestatic java.lang.Stringt(java.lang.String input, java.util.Locale locale, java.lang.Object... args)Translate the given string with the given input to the desired language
-
-
-
Method Detail
-
t
public static java.lang.String t(java.lang.String input, java.lang.Object... args)Translate the given string with the given input to the desired language- Parameters:
input-args-- Returns:
-
t
public static java.lang.String t(java.lang.String input, java.util.Locale locale, java.lang.Object... args)Translate the given string with the given input to the desired language- Parameters:
input-args-- Returns:
-
register
public static java.lang.String register(java.lang.String template)
Register a template key and return it. Useful mostly when you want to translate enum constants - for normal translation you will likely want to use the t method from this class This method does not do anything, but the gettext scanner recognizes it and adds it to the resource bundles- Parameters:
template-- Returns:
-
setCurrentLocale
public static void setCurrentLocale(java.util.Locale locale)
-
getCurrentLocale
public static java.util.Locale getCurrentLocale()
-
-