Package com.vaadin.flow.i18n
Interface I18NProvider
-
- All Superinterfaces:
Serializable
public interface I18NProvider extends Serializable
I18N provider interface for internationalization usage.- Since:
- 1.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description List<Locale>
getProvidedLocales()
Get the locales that we have translations for.String
getTranslation(String key, Locale locale, Object... params)
Get the translation for key with given locale.
-
-
-
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 keylocale
- locale to useparams
- parameters used in translation string- Returns:
- translation for key if found
-
-