Globalization
By default, the WebDAV files in the Simple Theme template are English only, but you can add other locales to your custom theme.
You must add and modify several files to add other locales to your custom theme.
Theme template (theme.html)
If your theme template contains translatable strings, you can delegate rendering to a specific HTML file for each locale. The following procedure adds support for German as an example, but you can add support for many other languages. Go to Language support to learn more about the languages that are supported by HCL Digital Experience.
-
Add the following tags to the head section of your theme template:
<link rel="alternate" href="nls/theme_de.html" hreflang="de">
<link rel="alternate" href="nls/theme_en.html" hreflang="en">
-
In WebDAV, create a new directory that is named
nls
infs-type1/themes/themename
. - Copy theme.html to theme_de.html and theme_en.html to the
nls
directory. - Translate the strings to German in theme_de.html.
- In theme_de.html, change the
lang
attribute in the HTML tag to de.
Skin template (skin.html)
The skin template contains English strings for the menu hover text. You can delegate rendering to a specific skin HTML file for each locale. The following procedure adds support for German as an example, but you can add support for many other languages. Go to Language support to learn more about the languages that are supported by HCL Digital Experience.
-
Add the following tag to the section tag of your template:
<a rel="alternate" href="nls/skin_de.html" hreflang="de" class="wpthemeDisplayNone"></a>
The section tag will look similar to the following sample section tag:
<section class="ibmPortalControl stControl wpthemeControl a11yRegionTarget"> <a rel="alternate" href="nls/skin_de.html" hreflang="de" class="wpthemeDisplayNone"></a> <a rel="alternate" href="nls/skin_en.html" hreflang="en" class="wpthemeDisplayNone"></a>
-
In WebDAV, create a new directory that is named
nls
infs-type1/themes/themename/yourskin
. - Copy skin.html toskin_de.html and skin_en.html to the
nls
directory. - Translate the strings to German in skin_de.html.
Profiles, menus, contributions, and other .json files
You can add title and description values for each locale to your .json files.
- Locate and open the .json file.
-
Locate the Titles element. To add a new locale, add its lang and value attributes, which are separated by commas:
"titles":[ { "lang":"de", value":"Verzögert" }, { "lang":"en", "value":"Deferred" } ]
-
Repeat Step 2, editing the lang and value attributes for descriptions.
-
Edit the class attribute in the body element from
locale_en
tolocale_lang
:<body id="content" class="lotusui30dojo tundra claro locale_lang
-
Adding support for RTL locales
You can add support for languages that read from right to left.