Versions Compared

Key

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

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

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

...

  1. based on your preference.
    For example, in Google Chrome, you can set the language

...

  1. by navigating to Settings, then Show advanced settings

...

  1. , 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

...

  1.  directory where <DS_HOME>

...

  1.  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

...

  1. that defines the localization strings in

...

  1. WSO2 Dashboard Server.

...

  1. The resource file is

...

  1. .json

...

  1.  file with the following name

...

  1. format - locale_{language_code}.json

...

  1.  (e.g., to make Sinhalese available you can name the JSON file as locale_si.json ). Each locale has a

...

  1. separate .json

...

  1.  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

...

  1. in .jag

...

  1.  files and client-side

...

  1. JavaScript files according to browser locale.

...

  1. Furthermore, WSO2 Dashboard Server uses its in-built script module

...

  1. i18n to implement the localization support for Jaggery. For more information,

...

  1. see http://jaggeryjs.org/documentation.jag?api=i18n.

...

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

...

  1. 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",
      ....