Business Service Control Localization
                                                                                and subdirectories. The resource bundles for Business Service Control are located within the src directory and are copied to the WASP-INFclasses directory during build phase.
Resource keys naming convention
The resource key is composed of JSP file name without suffix and an English identifier in camel notation. Capital letters are used to indicate the start of words, instead of a space or underscore. If the JSP file is located in some subdirectory of
the top-level directory, the subdirectory name is also encoded in the resource key. For example resources for JSP file s e a r c h  i n t e r f a c e s  s i m p l e . j s p
a r e   s t o r e d   i n   t h e   f i l e com.systinet.uddi.bui.standard.component.search.SearchMessages.properties
and all keys have the prefix interfaces.simple_.
In some configuration files it is necessary to use a custom resource bundle instead of the default bundle. There is a way to encode the custom resource bundle name into the resource key. If the resource key contains the character , then the
part before it will be treated as the resource bundle identifier and the rest of the resource key as actual resource key. For example customBundleresourceKey.
Localization of Configuration
The configuration files are localizable too. For example the file confbsc.xml has texts in the resource bundle com.systinet.uddi.bui.framework.BSCMessages.properties
. The attributes like caption and hint have their localizable alternatives captionKey and hintKey, which have precedence over the original attributes providing text. The
exception to this rule is the task element in the file confweb_component.xml, where caption attribute has precedence over new captionKey attribute.
JSP localization
The localization of JSP files uses the standard formatting tag library. Every JSP must start with import of this library and setting of the locale for the current user, if he is logged in. The users language is stored in the session variable
userDefaultLanguage .
Example 21. Example of localization
taglib prefix=fmt uri=http:java.sun.comjstlfmt c:if test={not empty globalSession[userName]}
fmt:setLocale value={globalSession[userDefaultLanguage]} scope=page c:if
fmt:setBundle basename=com.systinet.uddi.bui.standard.component.search.SearchMessages var=search_Message
fmt:message key=interfaces.simple_operationProperty bundle={search_Message}
In addition to the full power of the standard formatting library there are several extensions that complement localization needs.
ParseResourceKey tag
The parseResourceKey tag is used, when the resource key can contain an embedded resource bundle. It detects such a situation and introduces two new variables that will hold the values of resource bundle and resource key to be used.
Page 568
ParseResourceKey tag
Table 80.  ParseResourceKey tag Parameters
Required Description
Param
yes The resource key that may contain an embedded custom resource bundle.
key yes
Default resource bundle to use if no custom bundle is detected. defaultBaseName
yes Name of variable that will hold the name of the bundle for this resource.
varBundle yes
Name of variable that will hold resource key. varResource
Example 22. ParseResourceKey tag - Usage Example
syswf:parseResourceKey key={captionKey} defaultBaseName=com.systinet.uddi.bui.framework.WebComponentMessages
varBundle=bundleName varResource=finalCaptionKey fmt:setBundle basename={bundleName} var=dynamic_Message
fmt:message key={finalCaptionKey} var=dialogCaption bundle={dynamic_Message}
LocalizedFileName tag
LocalizedFileName tag finds the name of the localized file for the current locale. It uses the same heuristic search as resource bundle loading. For example if there is a file scripts.js and the french locale is set, then scripts_fr.js may
be returned.
Table 81.  localizedFileName tag Parameters
Required Description
Param
yes Prefix to be concatenated to fileName to access a resource from the
servlet context. basedir
no Name of file whose localized version is needed.
fileName yes
Name of variable that will hold the file name for the current locale. var
Example 23. localizedFileName - Usage Example
syswf:localizedFileName basedir=..webroot fileName=jsbui.js var=jsBui script language=JavaScript src=c:out value={jsBui}script
LocalizedInclude tag
Sometimes it is necessary to localize very long text and it would not be practical to store it in a resource bundle as a key, especially when the text contains formatting information. For this purpose there is a tag localizedInclude, which writes
to output the content of file selected in the current locale. The rules for file selection are same as for Resource bundles.
Table 82.  localizedInclude tag Parameters
Required Description
Param
yes Path to resource with the text to be written to output.
baseName
Example 24. localizedInclude - Usage Example
syswf:localizedInclude baseName=publishservicegenericselectInterfaces.html
Page 569
LocalizedInclude tag
Java localization
The localization of web applications uses standard resource bundles. It is necessary to use com.systinet.webfw.util.BundleHelper
instead of java.util.ResourceBundle to retrieve a resource bundle otherwise different rules for locale selection will be used in the java code and JSP files, which results in page with portions
in different languages.