The Dashboard Server comes with one Web interfaces, Portal. The following steps show an example of how to localize the Portal app.
Changing the browser settings
Follow the instructions in your Web browser's user guide and set the browser's language to a preferred one. For example, in Google Chrome, you set the language using the Settings -> Show advanced settings -> Languages menu.
Set the browser's encoding type to UTF-8.
Introduction to resource files
Go to <DS_HOME>/repository/deployment/server/jaggeryapps/portal directory where <DS_HOME> is the Dashboard Server distribution's home.
There is only one type of resource file used to define localization strings in the Dashboard Server. That is a .json file with the name prefixed as locale_{language_code}.json (Example:- for sinhalese available json file named as “locale_si.json” ). Each locale has a seperate .json file. These files are located at ..portal/extensions/locales. These resource files are used to store strings defined in .jag files and client side javascript files according to browser locale. For example,
To implement localization support for jaggery, we use its in-built script module 'i18n'. For more information, refer to http://jaggeryjs.org/documentation.jag?api=i18n.
Localizing strings in Dashboard Server
To localize the Dashboard Server to Spanish, Create a new file by the name locale_{lolcaleCode}.json inside ...portal/extensions/locales folder. For example, if the language set in the browser is Spanish, the locale code is es and the file name should be locale_es.json.
Add the key-value pairs to locale_es.json file. For an example on adding key value pairs, refer to locale_default.json file in ...portal/extensions/locales folder. It is the default resource file for Dashboard Server.
In addition, a section of a sample locale_es.json file is shown below for your reference.