Localizing WSRP Portlet Metadata
To provide localized portlet metadata, configure the WSRP
Producer to use localized strings and provide the necessary resource
files.
The .NET Application Accelerator supports standard ASP.NET
mechanisms for localizing portlet markup. In addition, you can localize
WSRP portlet metadata through the wsrp-producer.xml file. Localizable
elements are those derived from the schema type “localizableStringType”.
These are:
- portlet/description
- portlet/display-name
- portlet/portlet-info/title
- portlet/portlet-info/short-title
- property/label
- property/hint
- portlet/supports/window-state/description
- portlet/supports/portlet-mode/description
- custom-portlet-mode/description
- custom-window-state/description
For a complete list of elements in the wsrp-producer.xml file,
see
WSRP Producer Configuration Elements (wsrp-producer.xml).
- Configure the portlet metadata in wsrp-producer.xml to
use “key” attributes to reference strings. You can include a default
language and value as shown in the example below..
<portlet>
...
<display-name lang="en" key="my-display-name">My Portlet</display-name>
<description lang="en" key="my-description">Displays data</description>
...
</portlet>
- Create a subdirectory for each supported locale in the
directory containing the WSRP Producer assembly. For example, if locales
“es”, “es-ES”, and “en” are supported, you would use the following
structure:
- Create resource files that define localized strings for
all supported languages and place them in the appropriate locale-specific
directory. Resource files must be named according to the filename
convention {resource-class}.{locale}.resources. for example myportlet.es.resources
and wsrp-producer.es.resources.
- For all resource strings that are declared as a descendent of
a <portlet> element, the resource-class name
is the value of the portlet handle.
- For all other resource strings, the resource-class name is “wsrp-producer”.
Note: .NET resource files must be created using the resgen.exe
tool (included in Visual Studio and the .NET SDK).