Package dev.voidframework.i18n
Class ResourceBundleInternationalization
java.lang.Object
dev.voidframework.i18n.ResourceBundleInternationalization
- All Implemented Interfaces:
Internationalization
public final class ResourceBundleInternationalization
extends Object
implements Internationalization
Resource bundle based internationalization.
- Since:
- 1.0.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAllMessages(Locale locale) Retrieves all messages with linked key.getMessage(Locale locale, long quantity, String key, Object... argumentArray) Retrieves a message.getMessage(Locale locale, String key) Retrieves a message.getMessage(Locale locale, String key, Object... argumentArray) Retrieves a message.
-
Constructor Details
-
ResourceBundleInternationalization
public ResourceBundleInternationalization()Build a new instance.- Since:
- 1.0.0
-
-
Method Details
-
getMessage
Description copied from interface:InternationalizationRetrieves a message.- Specified by:
getMessagein interfaceInternationalization- Parameters:
locale- The locale corresponding to the translation to be usedkey- The message key- Returns:
- The message, otherwise, a String containing the message key surrounded with "%"
-
getMessage
Description copied from interface:InternationalizationRetrieves a message.- Specified by:
getMessagein interfaceInternationalization- Parameters:
locale- The locale corresponding to the translation to be usedkey- The message keyargumentArray- The message arguments- Returns:
- The message, otherwise, a String containing the message key surrounded with "%"
-
getMessage
Description copied from interface:InternationalizationRetrieves a message.- Specified by:
getMessagein interfaceInternationalization- Parameters:
locale- The locale corresponding to the translation to be usedquantity- The quantity to determine the plural key to usekey- The message keyargumentArray- The message arguments- Returns:
- The message, otherwise, a String containing the message key surrounded with "%"
-
getAllMessages
Description copied from interface:InternationalizationRetrieves all messages with linked key.- Specified by:
getAllMessagesin interfaceInternationalization- Parameters:
locale- The locale- Returns:
- A
Mapcontaining all messages with linked key
-