Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Note

The following locales are supported (a green tick indicates a supported locale). All other locales that are added will not be displayed.

Locale8.3.38.3.4Notes

English (en_US)

(tick)(tick)Default locale.

Chinese (zh_CN)

(tick)(tick)This locale has been fully translated already and is delivered in the WAR from v. 1.10.0.

French (fr_FR)

(error)(tick)These locales have note been translated and therefore require manual translation before the dashboard locale can be set to one of them.

German (de_DE) 

(error)(tick)

Japanese (ja_JP)

(error)(tick)

Korean (ko_KR)

(error)(tick)

Portuguese (pt_PT)

(error)(tick)

Spanish (es_ES)

(error)(tick)

Turkish (tr_TR)

(error)(tick)


...

Info
Note that it is possible to manually modify the translation.json file embedded in the WAR file instead of passing through the POT > PO > JSON mechanism, however if you want to work with a translator, CAST highly recommends that you use the process described in this guide.

Step 1: Translation

Provide the .POT file to your translator. The .POT files are embedded in the CAST dashboard WAR/ZIP files at the following locations:

Code Block
languagetext
WAR 1.x
Health Dashboard: portal\locales\aad-localization.pot
Engineering Dashboard: engineering\locales\aed-localization.pot

WAR ≥ 2.x
Health Dashboard: static\portal\locales\aad-localization.pot 
Engineering Dashboard: static\engineering\locales\aed-localization.pot

ZIP ≥ 2.x - The files are located in a compiled JAR file located at the root of the unpacked ZIP. This JAR file will need to be unpacked to find the files:
Health Dashboard: <unpacked_jar>\BOOT-INF\classes\static\portal\locales\aad-localization.pot 
Engineering Dashboard: <unpacked_jar>\BOOT-INF\classes\static\engineering\locales\aed-localization.pot 

The translator then needs to edit and translate the .POT file to create a resulting .PO file containing the translated text and messages. CAST highly recommends using the third party tool https://poedit.net/ to achieve this.

Step 2: Preparation

Code Block
languagetext
npm install i18next-conv -g

Then, in the place where your .PO file is located, run the following commands (change the local code to the language you require):

Code Block
languagetext
i18next-conv -l en -s ./locales/zh_CN.po -t ./locales/zh_CN/translation.json
i18next-conv -l en -s ./locales/zh_CN.mo -t ./locales/zh_CN/translation.json

Step 3: Integration

Find the target language <locale> folder located in:

Code Block
languagetext
WAR 1.x
Health Dashboard: portal\locales\
Engineering Dashboard:

...

 engineering\locales\

WAR ≥ 2.x
Health Dashboard: static\portal\locales\
Engineering Dashboard: static\engineering\locales\

ZIP ≥ 2.x - The files are located in a compiled JAR file located at the root of the unpacked ZIP. This JAR file will need to be unpacked to find the files and repacked when the locales files have been populated
Health Dashboard: 

...

<unpacked_jar>\BOOT-INF\classes\static\portal\locales\
Engineering Dashboard: <unpacked_jar>\BOOT-INF\classes\static\engineering\locales

For example, if you are translating into zh_CN, a folder called engineering/locales/zh_CN or portal/locales/zh_CN will already exist for you

...

. Copy the translation.json to the locale folder

...

and then restart the web application server.

...

Now click the user name from the top menu and select the Change Language option. Your new language will be available in the drop down - select it to view the dashboard in your chosen language.

Setting the default language

...

If you would prefer to have your new language as the default for all users, then : update the following file:

Code Block
languagetext
WAR 1.x
Engineering Dashboard: CATALINA_HOME\webapps\CAST-Engineering<dashboard>\engineering\resources\ed.json
Health Dashboard: CATALINA_HOME\webapps\CAST-Health\portal\resources\cmp.json
 
WAR ≥ 2.x
Engineering Dashboard: CATALINA_HOME\webapps\<dashboard>\WEB-INF\classes\config\ed\ed.json
Health Dashboard: CATALINA_HOME\webapps\<dashboard>\WEB-INF\classes\config\hd\cmp.json
 
ZIP ≥ 2.x
Engineering Dashboard: <unpacked_zip>\config\ed\ed.json
Health Dashboard: <unpacked_zip>\config\hd\cmp.json

Change the defaultLanguage option to match the official name for the locale you have added. The dashboard is aware of the official locale names and will match the official name with a locale folder. So adding "Chinese" (as shown below) will force the dashboard to look for a zh_CN locale folder:

Code Block
languagetext
Engineering Dashboard 
 
 "configuration": {
    "defaultLanguage": "Chinese",
    "requestAccess": false,
    "confirmLogout": true,
    "filterHealthFactor": true,
    "violationsCount" : 5000,
    "navigation": {
      "pages": [
      ]
    },
 
Health Dashboard

    "title": "Health Dashboard",
    "defaultLanguage": "Chinese",
    "horizontalScroll": false,
    "requestAccess": false,
    "confirmLogout": true,
    "persistNavigationFilters":true,
    "filtering":{
      "filterTags":true
    },
  • Save the engineering\resources\ed.json or portal\resources\cmp.json file.
  • Restart the web application server to view the translated dashboard.

...