public class I18NModule extends ModuleSupport<Void> implements PluginContextBuilder, org.springframework.context.MessageSourceAware
Module rejestrujący obiekt MessageSource w kontekście wtyczki.
Pobranie tłumaczenia może odbyć się na 2 sposoby:
1. wywołanie metody na obiekcie wtyczki: Plugin.getMessage(String, java.util.Locale, Object...)
2. wstrzyknięcie obiektu MessageSource do konkretnego komponentu
Note: Aktualny język dla żądania odczytujemy korzystając z LocaleContextHolder.getLocale()
| Modifier and Type | Field and Description |
|---|---|
static String |
MODULE_TYPE |
logger| Constructor and Description |
|---|
I18NModule() |
| Modifier and Type | Method and Description |
|---|---|
void |
buildContext(PluginContext pluginContext)
Budowa kontekstu wtyczki.
|
protected void |
initModule() |
void |
setMessageSource(org.springframework.context.MessageSource messageSource) |
disable, enable, getDefinition, getKey, getObject, getObjectClass, getPlugin, init, toStringpublic static final String MODULE_TYPE
public void setMessageSource(org.springframework.context.MessageSource messageSource)
setMessageSource in interface org.springframework.context.MessageSourceAwareprotected void initModule()
throws PluginsException
initModule in class ModuleSupport<Void>PluginsExceptionpublic void buildContext(PluginContext pluginContext)
PluginContextBuilderbuildContext in interface PluginContextBuilderpluginContext - budowany kontekst wtyczkiCopyright © 2014 Suncode. All rights reserved.