Interface TranslationStore
public interface TranslationStore
Renders translatable components into a given locale.
A single store is active at a time, reachable statically through current() or from
Server.translationStore().
- Since:
- 0.1.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic TranslationStorecurrent()Gets the active translation store implementation.static LocaleGets the default locale of the current translation store.Returns the locale used when a translation is missing in the requested one.voidload()Loads the translations; called when the store becomes active.static ComponentRenders a component using a locale.renderComponent(Component component, Locale locale) Renders a component, translating every translatable part into a locale.static voidsetStore(TranslationStore store) Replaces the active translation store implementation, loading it and unloading the previous one.voidunload()Releases the translations; called when another store replaces this one.
-
Method Details
-
setStore
Replaces the active translation store implementation, loading it and unloading the previous one.- Parameters:
store- newTranslationStore
-
current
Gets the active translation store implementation.- Returns:
- active
TranslationStore
-
render
-
defaultLocale
-
renderComponent
-
getDefaultLocale
Locale getDefaultLocale()Returns the locale used when a translation is missing in the requested one.- Returns:
- the locale used when a translation is missing in the requested one
- Since:
- 0.1.0
-
load
void load()Loads the translations; called when the store becomes active.- Since:
- 0.1.0
-
unload
void unload()Releases the translations; called when another store replaces this one.- Since:
- 0.1.0
-