Package eu.woolplatform.utils.i18n
Class I18n
- java.lang.Object
-
- eu.woolplatform.utils.i18n.I18n
-
public class I18n extends Object
This class defines a set of i18n message resources. An instance of this class is normally obtained fromI18nLoader. It usesI18nResourceFinderto find a matching properties file, in .properties format or .xml format. Note that a .properties file will be loaded as UTF-8.When you have an instance, you can call
get()to get message strings.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringget(String code)Returns the message string with the specified code.
-
-
-
Constructor Detail
-
I18n
public I18n(String baseName, List<Locale> locales, boolean honorifics, Class<?> loadClass) throws RuntimeException
Constructs a new instance. It finds a matching resource (.properties or .xml) for the specified parameters and tries to load it. Note that a .properties file will be loaded as UTF-8. For more details seeI18nResourceFinder.- Parameters:
baseName- the base namelocales- the preferred localeshonorifics- true if the resource should use honorifics, false otherwiseloadClass- the resource loading class or null- Throws:
RuntimeException- if no matching resource is found, or a matching resource can't be loaded
-
-