Oops... looks like the spiders padded through here
Add products to your cart and remove them from here Lets buypublic interface TranslationsProvider
| Modifier and Type | Method and Description |
|---|---|
void |
changeTranslation(Locale locale)
Changes the current translation locale.
|
Locale |
getCurrentLocale()
Gets the current locale being used for translations.
|
Plugin |
getPlugin()
Gets the plugin associated with this translations' provider.
|
NavigableMap<String,String[]> |
getTranslations()
Gets the translations map, which stores translation keys and their respective values.
|
void |
loadDefaultResource(String resource)
Loads a default translation resource into the system.
|
void |
loadTranslations(String namespace,
Function<Locale,TranslationFetcher> fetcher)
Loads translations for the given namespace using a per-locale fetcher factory.
|
String[] |
translate(Translation translation)
Translates a given translatable object into the current locale.
|
String[] |
translateOrNull(Translation translation)
Translates a given translatable object into the current locale.
|
Plugin getPlugin()
Plugin instanceLocale getCurrentLocale()
Locale
NavigableMap<String,String[]> getTranslations()
NavigableMap containing translation entriesvoid changeTranslation(Locale locale) throws Exception
locale - the new Locale to useException - if an error occurs while changing the translationvoid loadDefaultResource(String resource)
throws Exception
resource - the name of the resource to loadException - if an error occurs while loading the resourcevoid loadTranslations(String namespace,
Function<Locale,TranslationFetcher> fetcher)
throws Exception
Implementations should iterate the relevant locales and for each locale call
fetcher.apply(locale) to obtain a TranslationFetcher for that locale.
The returned fetcher should then be used to retrieve translations which implementations
will store or merge under the provided namespace.
namespace - logical group or prefix under which fetched translations will be storedfetcher - a function that accepts a Locale and returns a TranslationFetcher for that localeException - if an error occurs while fetching, loading, or parsing translationsString[] translate(Translation translation)
translation - the Translation to translateString[] translateOrNull(Translation translation)
translation - the Translation to translate
Oops... looks like the spiders padded through here
Add products to your cart and remove them from here Lets buy