Package io.gravitee.am.service.i18n
Class ThreadLocalDomainDictionaryProvider
java.lang.Object
io.gravitee.am.service.i18n.ThreadLocalDomainDictionaryProvider
- All Implemented Interfaces:
DictionaryProvider,DynamicDictionaryProvider
public class ThreadLocalDomainDictionaryProvider
extends Object
implements DynamicDictionaryProvider
DictionaryProvider that allow the usage of a dictionary in an ephemeral context (REST Call).
This provider is used to provide the i18n dictionary in order to allow preview in ManagementAPI with right translation.
- Author:
- Eric LELEU (eric.leleu at graviteesource.com), GraviteeSource Team
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetDictionaryFor(Locale locale) Get the Properties object with all i18n message translated for the given locale value.booleanhasDictionaryFor(Locale locale) use the local.toString instead of local.getLanguage() to evaluate language linked to a country code (fr-FR / en-GB)voidloadDictionary(I18nDictionary i18nDictionary) voidremoveDictionary(String locale) void
-
Constructor Details
-
ThreadLocalDomainDictionaryProvider
public ThreadLocalDomainDictionaryProvider()
-
-
Method Details
-
getDictionaryFor
Description copied from interface:DictionaryProviderGet the Properties object with all i18n message translated for the given locale value. If there are no properties matching the Locale, then the default translation are provided.- Specified by:
getDictionaryForin interfaceDictionaryProvider- Returns:
-
hasDictionaryFor
Description copied from interface:DictionaryProvideruse the local.toString instead of local.getLanguage() to evaluate language linked to a country code (fr-FR / en-GB)- Specified by:
hasDictionaryForin interfaceDictionaryProvider- Returns:
- true if the locale has dictionary
-
loadDictionary
- Specified by:
loadDictionaryin interfaceDynamicDictionaryProvider
-
removeDictionary
- Specified by:
removeDictionaryin interfaceDynamicDictionaryProvider
-
resetDictionaries
public void resetDictionaries()- Specified by:
resetDictionariesin interfaceDynamicDictionaryProvider
-