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 obiektuMessageSource
do konkretnego komponentu Note: Aktualny język dla żądania odczytujemy korzystając zLocaleContextHolder.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, toString
public static final String MODULE_TYPE
public void setMessageSource(org.springframework.context.MessageSource messageSource)
setMessageSource
in interface org.springframework.context.MessageSourceAware
protected void initModule() throws PluginsException
initModule
in class ModuleSupport<Void>
PluginsException
public void buildContext(PluginContext pluginContext)
PluginContextBuilder
buildContext
in interface PluginContextBuilder
pluginContext
- budowany kontekst wtyczkiCopyright © 2014 Suncode. All rights reserved.