Internationalization and localization of CDE dashboards

Dashboards can be internationalized and localized. Several files need to be created in order to perform the dashboard translation, all with .properties extension and their location needs to be the same as the dashboard.

How toconfigure?

As mentioned before, some files need to be created and configured properly:

en_US and ja correspond to the language and country codes and English and \u65E5\u672C\u8A9E are the languages names.

Note:Special characters such as Japanese characters or "Ç" for instance or even accents need to be Ascii encoded (Native2ascii Online), otherwise the characters are not displayed correctly in the dashboard.

The translation file name should have this format

messages_<language>.properties- language corresponds to the language code, specified in the messages_supported_languages.properties. File name examples:

messages_en.properties

messages_ja.properties

messages_<language>_<COUNTRY>.properties - COUNTRYcorresponds to the country code, uppercase code ISO ALPHA-2. Whenever, you add this type of file, do not forget to add <language>_<COUNTRY> to messages_supported_languages.properties file. Otherwise, the configured translation file will never be used.

messages.properties - is the translation fallback file, the default translation, in case of something not being configured well in translation functionality. The file should have the same structure as described for messages_<language>_<COUNTRY>.properties and messages_<language>.properties.

How is messages.properties structure hierarchical?

Translations or messages can be created in multiple translation files. Whenever that happens, keep in mind the following hierarchy:

Imagine that you want to build a CDE dashboard with only a title for English and Japanese languages. You construct the CDE layout and then you add the Text Component element. In the Expression of the latter, place the following code that calls a CDF API- prop function fromi18nSupport, that uses the translation file according to the PUC language:

function f(){

return this.dashboard.i18nSupport.prop('dashboardTitle');

}

Additionally, message.properties and message_en.properties should have:

When you want to test the translation configuration, you need to go to View Tab, choose Languages option and then select English or Japanese language. After that, you need to reload the dashboard, if it was already opened, or open the dashboard and you will see that the translation showed respects the PUC language chosen.