On this page:
Introduction
By default, the CAST Application Analytics and Engineering Dashboards are delivered with language display set to English: all messages and text displayed in the dashboard is only displayed in English. However, it is now possible to set a specific locale and provided that a translation of the default English text and messages has been configured, the dashboards will then display text and messages in the chosen language.
The process of internationalizing the dashboard is shown in the image below - click to enlarge:
Step 1: Translation
- Provide .POT resource to translator. .POT file contains the text and messages for translation
- The translator translates the text and messages to some other language (e.g. fr_FR)
- The translator sends back the the translation as a .PO file
Step 2: Preparation
- The .PO file needs to be converted to .JSON format so it can interpreted correctly by the CAST AIP dashboards.
- The .JSON file to be renamed translation.json
Step 3: Integration
- Copy the translation.json to the portal/locales/<locale> (AAD) or engineering/locales/<locale> (AED) folders within the deployed WAR files
- Edit the portal/resources/cmp.json (AAD) or engineering/resources/ced.json (AED) files to define the language parameter to the locale desired (in the example, fr_FR)
- Restart the web application server to view the translated dashboards.
Step 1: Translation
- Provide the .POT file to your translator. The .POT files are embedded in the CAST dashboard WAR files at the following locations:
AAD: portal\locales\aad-localization.pot AED: 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
- Convert the .PO file to a .JSON file using a third party tool: http://i18next.com/. A command line interface is provided to do the conversion: https://github.com/i18next/i18next-gettext-converter
- i18next requires that node.js is installed on the machine which will be running the conversion
- Install using the command:
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):
i18next-conv -l en -s ./locales/fr_FR.po -t ./locales/fr_FR/translation.json i18next-conv -l en -s ./locales/fr_FR.mo -t ./locales/fr_FR/translation.json
Step 3: Integration
For AAD
- Create a new folder called <locale> in portal/locales. For example, if you are translating into fr_FR, create a folder called portal/locales/fr_FR.
- Copy the translation.json to the portal/locales/fr_FR folder within the deployed WAR file.
- Update or define the language parameter in the portal/resources/cmp.json file to match the language you have translated into:
{ "title": "Application Analytics Dashboard", "language": "fr_FR", ...
- Save the portal/resources/cmp.json file.
- Restart the web application server to view the translated dashboard.
For AED
- Create a new folder called <locale> in engineering/locales. For example, if you are translating into fr_FR, create a folder called engineering/locales/fr_FR.
- Copy the translation.json to the engineering/locales/fr_FR folder within the deployed WAR file.
- Update or define the language parameter in the engineering/resources/ced.json file to match the language you have translated into:
{ "description": "...", "configuration": { "confirmLogout": true, "filterHealthFactor": true, "language": "fr_FR", ...
- Save the engineering/resources/ced.json file.
- Restart the web application server to view the translated dashboard.
Specific tips for the CAST Application Analytics Dashboard
The way the CAST Application Analytics Dashboard is built means that the translation.json file is not the only source of text/messages that are displayed in the dashboard:
- portal/locales/translation.json contains lots of translatable strings that will apply throughout the dashboard. As for AED, this is the main source of localization for texts in AAD.
- portal/resources/cmp.json defines the home page and detail pages at portfolio level. Numerous texts that will be displayed in AAD come from this resource.
- portal/resources/app.json defines the home page at application level. Tile texts are defined in this file (as for cmp.json)
- portal/resources/internal/app-navigation.json contains application level detail configuration, including some texts.
To full translate the CAST Application Analytics Dashboard, you need to work through all of these resources.
What is not translatable in AAD / AED?
- Assessment Model information (Quality Rule documentation)
- All texts that come from the API (i.e. the database) are not translatable
- Other texts in CSS resources, third party components or in configuration json files.