Package io.mangoo.i18n
Class Messages
- java.lang.Object
-
- io.mangoo.i18n.Messages
-
- All Implemented Interfaces:
Serializable
public class Messages extends Object implements Serializable
Convenient class for handling translations- Author:
- svenkubiak
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Messages()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringget(Key key, Object... arguments)Returns a localized value for a given key stored in messages_xx.properties and passing the given argumentsStringget(String key)Returns a localized value for a given key stored in messages_xx.propertiesStringget(String key, Object... arguments)Returns a localized value for a given key stored in messages_xx.properties and passing the given argumentsvoidreload(Locale locale)Refreshes the resource bundle by reloading the bundle with the default locale
-
-
-
Method Detail
-
reload
public void reload(Locale locale)
Refreshes the resource bundle by reloading the bundle with the default locale- Parameters:
locale- The locale to use
-
get
public String get(String key)
Returns a localized value for a given key stored in messages_xx.properties- Parameters:
key- The key to look up the localized value- Returns:
- The localized value or an empty value if the given key is not configured
-
get
public String get(String key, Object... arguments)
Returns a localized value for a given key stored in messages_xx.properties and passing the given arguments- Parameters:
key- The key to look up the localized valuearguments- The arguments to use- Returns:
- The localized value or null value if the given key is not configured
-
get
public String get(Key key, Object... arguments)
Returns a localized value for a given key stored in messages_xx.properties and passing the given arguments- Parameters:
key- The key enum to lookup up the localized valuearguments- The arguments to use- Returns:
- The localized value or null value if the given key is not configured
-
-