Interface Localizer

All Superinterfaces:
Implementation.ExtensionProvidable
All Known Implementing Classes:
FluavaLocalizer

public non-sealed interface Localizer extends Implementation.ExtensionProvidable

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 Type
    Method
    Description
    localize(Locale locale, String bundle, String key, Map<String, @Nullable Object> arguments)
    This method localizes a given key for a specific bundle and locale.
  • Method Details

    • localize

      Optional<String> localize(Locale locale, String bundle, String key, Map<String, @Nullable Object> arguments)
      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 occurred Optional.empty() should be returned.
      Parameters:
      locale - the asked for locale
      bundle - the bundle to search the key in
      key - the key of the message
      arguments - values for placeholder in the message
      Returns:
      the localized message or Optional.empty() if no key is found/an error occurred