Interface Localizer
- All Superinterfaces:
Implementation.ExtensionProvidable
- All Known Implementing Classes:
FluavaLocalizer
A Localizer
is used to localize a given key for a specific bundle and locale.
Implementations of this interface will commonly delegate the task to a localization framework like
Fluava
.
For an example implementation take a look at FluavaLocalizer
-
Method Summary
Modifier and TypeMethodDescriptionThis method localizes a given key for a specific bundle and locale.This method localizes the given message content for the specific locale and arguments.
-
Method Details
-
localize
This method localizes a given key for a specific bundle and locale. If no message is found for this combination of locale, bundle and key or an error occurredOptional.empty()
should be returned.- Parameters:
locale
- the asked for localebundle
- the bundle to search the key inkey
- the key of the messagearguments
- values for placeholder in the message- Returns:
- the localized message or
Optional.empty()
if no key is found/an error occurred
-
localizeMessage
This method localizes the given message content for the specific locale and arguments. The purpose of this method is to support replacing placeholders in text fields of components, embeds and modals that aren't retrieved fromlocalize(Locale, String, String, Map)
- Parameters:
locale
- the asked for localecontent
- the content of the message to be localized, the content should be treated as if it's received from some localization filearguments
- values for placeholder in the message- Returns:
- the localized message or
Optional.empty()
if an error occurred
-