Versions Compared

Key

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

The Dashboard Server comes with one Web interface, namely the Portal. The following instructions provide an example on how to localize the Portal app to appear in Spanish.

Table of Contents

Step 1 - Change the browser settings

  1. Follow the instructions provided in your Web browser's user guide and set the browser's language based on your preference.
    For example, in Google Chrome, you can set the language by navigating to Settings, then Show advanced settings, and clicking on Languages menu.
  2. Set the browser's encoding type to UTF-8.

Step 2 - Localize the strings in WSO2 Dashboard Server

  1. Navigate to the <DS_HOME>/repository/deployment/server/jaggeryapps/portal directory where <DS_HOME> is the WSO2 Dashboard Server distribution's home.
  2. Create a new file by the name locale_{lolcaleCode}.json inside the <DS_HOME>/repository/deployment/server/jaggeryapps/portal/extensions/locales directory to localize the Dashboard Server to your preferred language. 
    Based on this example, as the language set in the browser is Spanish, the locale code is es and the file name should be locale_es.json.

    Info

    There is only one type of resource file that defines the localization strings in WSO2 Dashboard Server. The resource file is a .json file with the following name format - locale_{language_code}.json (e.g., to make Sinhalese available you can name the JSON file as locale_si.json ). Each locale has a separate .json file, and these files are located in the <DS_HOME>/repository/deployment/server/jaggeryapps/portal/extensions/locales directory. These resource files are used to store the strings defined in .jag files and client-side JavaScript files according to browser locale. Furthermore, WSO2 Dashboard Server uses its in-built script module i18n to implement the localization support for Jaggery. For more information, see http://jaggeryjs.org/documentation.jag?api=i18n.

  3. Add the key-value pairs in the resource file, which in this example is the locale_es.json file.

    Info
    • For an example on adding key value pairs, refer to the default resource file for WSO2 Dashboard Server, which is namely the <DS_HOME>/repository/deployment/server/jaggeryapps/portal/extensions/locales/locale_default.json file.
    • In addition, a section of a sample locale_es.json file is shown below for your reference.

      Code Block
      {
       "edit.button": "editar",
       "logout.label": "Cerrar sesión",
       "login.label": "Iniciar sesión",
       "username": "Nombre de usuario",
       "password": "Contraseña",
       "create.page.label": "Crear página",
      ....