Resource bundles to support a Portal based custom theme
We can add supported locale to the system. We must provide resource bundles for the new language to the Portal based custom theme to enable them. Vietnamese is used as an example language in the following steps.
- Run the following XML to create the "Vietnamese" language. Click the Administration menu icon. Then, click Portal Settings > Import XML.
<?xml version="1.0" encoding="UTF-8"?> <request xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" type="update" xsi:noNamespaceSchemaLocation="PortalConfig_8.5.0.xsd"> <portal action="locate"> <language action="update" bidi="false" domain="rel" locale="vi_vn"> <localedata locale="en_us"> <title>Vietnamese</title> </localedata> </language> </portal> </request>- Copy the contents of the following files from the Portal server into a new file called language_vi_vn.js:
- PortalServer_root/theme/wp.theme.modules/webapp/installedApps/ThemeModules.ear/ThemeModules.war/modules/pagebuilder/js/nls/pb_ui_layer_en_us.js
- PortalServer_root/theme/wp.theme.modules/webapp/installedApps/ThemeModules.ear/ThemeModules.war/modules/portalclient/js/nls/rest_utils_en_us.js
- If we use Active Site Analytics PortalServer_root/theme/wp.theme.modules/webapp/installedApps/ThemeModules.ear/ThemeModules.war/modules/asa/js/nls/asa_layer_en_us.js
- If we use Tagging and Rating PortalServer_root/theme/wp.theme.modules/webapp/installedApps/ThemeModules.ear/ThemeModules.war/modules/portalclient/js/nls/tagging_rating_en_us.js
- In the language_vi_vn.js file, replace all instances of:
en_us")with:vi_vn")and all instances of:.en_us=with:.vi_vn=- Place the language_vi_vn.js file into the js folder of your custom theme. For example, dav:fs-type1/themes/custom_theme/js.
- Create a theme module for the language_vi_vn.js file by creating a languages.json file with the following contents:
{ "modules":[{ "id":"custom_languages", "prereqs":[{ "id":"dojo" }], "contributions":[{ "type":"head", "sub-contributions":[{ "type":"js", "uris":[{ "value":"/js/language_vi_vn.js", "lang":"vi_vn" }] }] }] }] }For more information about theme modules, see Registering theme modules.- Place languages.json into the contributions folder of your custom theme. For example, dav:fs-type1/themes/custom_theme/contributions.
- Add custom_languages as the first module in the section that includes Dojo for each profile in your custom theme.For example, in the Portal theme, the custom_languages module would be added to the moduleIDs section of the Lightweight profile and the deferredModuleIDs section of the Deferred profile.For more information, see Adding or removing a ready-to-use module to a theme.
- Restart the portal to pick up the new language and module contribution.
Parent topic: Add resource bundles for a new language
References: