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