public final class MVCPortletLanguageService extends java.lang.Object implements PortletLanguagePlugIn
The language plug-in maps the portlet session locale into a corresponding WebSphere Commerce language Id.
The current language used in the Portal environment can be retrieved as an Locale object from either the action request or render request via getLocale() method. An additional Locale-to-LanguageId map is required to convert the Portal locale into an equivalent language Id for use in the MVC Portlet business context. This map can be defined as a property file, WEB-INF/classes/language.properties, and will have the following format:
Locale name = WebSphere Commerce language Id
For example, en = -1.
Constructor and Description |
---|
MVCPortletLanguageService() |
Modifier and Type | Method and Description |
---|---|
void | destroy()
Destroy routine for the plugin before shutting down.
|
java.lang.String | getLanguageId(java.util.Locale locale, java.lang.String defaultLangId)
This method retrieves the corresponding Commerce internal langId.
|
void | init(javax.portlet.PortletConfig portletConfig)
Initialization routine for the plugin on starting up.
|
public java.lang.String getLanguageId(java.util.Locale locale, java.lang.String defaultLangId)
public void init(javax.portlet.PortletConfig portletConfig) throws javax.portlet.PortletException
public void destroy() throws javax.portlet.PortletException