Interface I18NProvider

  • All Superinterfaces:
    Serializable

    public interface I18NProvider
    extends Serializable
    I18N provider interface for internationalization usage.
    Since:
    1.0
    • Method Detail

      • getProvidedLocales

        List<Locale> getProvidedLocales()
        Get the locales that we have translations for. The first locale should be the default locale.
        Returns:
        provided locales
      • getTranslation

        String getTranslation​(String key,
                              Locale locale,
                              Object... params)
        Get the translation for key with given locale.

        Note! For usability and catching missing translations implementation should never return a null, but an exception string e.g. '!{key}!'

        Parameters:
        key - translation key
        locale - locale to use
        params - parameters used in translation string
        Returns:
        translation for key if found
      • getTranslation

        default String getTranslation​(Object key,
                                      Locale locale,
                                      Object... params)
        Get the translation for key with given locale.

        Note! For usability and catching missing translations implementation should never return a null, but an exception string e.g. '!{key}!'

        Parameters:
        key - translation key
        locale - locale to use
        params - parameters used in translation string
        Returns:
        translation for key if found