Interface ILocalizer
- All Known Implementing Classes:
ILocalizer.DummyLocalizer, PersonalizedLocalizer
public interface ILocalizer
Represents a class that can localize strings.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA dummy localizer that returns the key, locale and arguments in a string. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ILocalizerA dummy localizer that returns the key, locale and arguments in a string. -
Method Summary
Modifier and TypeMethodDescriptionGets a list ofLocales that are currently available.default StringgetMessage(String key, Object... args) Retrieves a localized message using the default locale.getMessage(String key, @Nullable Locale clientLocale, Object... args) Retrieves a localized message.
-
Field Details
-
NULL
A dummy localizer that returns the key, locale and arguments in a string.
-
-
Method Details
-
getMessage
Retrieves a localized message.- Parameters:
key- The key of the message.clientLocale- The Locale configured for the client. If the configuration does not allow client-specific locales or if the provided Locale is null, this parameter is ignored.args- The arguments of the message, if any.- Returns:
- The localized message associated with the provided key.
-
getMessage
Retrieves a localized message using the default locale.- Parameters:
key- The key of the message.args- The arguments of the message, if any.- Returns:
- The localized message associated with the provided key.
- Throws:
MissingResourceException- When no mapping for the key can be found.
-
getAvailableLocales
-