Internationalization and localization support

In Siren Investigate, only a select subset of elements can be translated. To report any problems with this feature or to request further information, contact Siren.

Internationalization is enabled in both the core application and the core plugins. To use this feature, you must generate a translation file and replace the values inside it with the language of the required locale. If you have additional custom plugins, you must also enable internationalization support for them.

Table 1. Supported languages and locales
Language Locale name

English

en

Spanish

es

French

fr

German

de

Japanese

ja

Korean

ko

Chinese

zh

Arabic

ar

Thai

th

Polish

pl

Ukrainian

uk

Portuguese

pt

Romanian

ro

Hindi

hi

Punjabi (India, Gurmukhi)

pa

Localizing Siren Investigate

To customize Siren Investigate to a particular locale, generate a locale file for the core application as follows:

  1. In the siren-investigate folder, open a Terminal window and execute the following command:

    • Linux and MacOS:

      node/bin/node scripts/i18n_extract.js --output-dir translations
    • Windows:

      node\node scripts\i18n_extract.js --output-dir translations

      This command generates a file called en.json in the siren-investigate/translations folder. The en.json file contains a messages object, which at a minimum contains the following code in English, the default language:

      "messages": {
        "kbn.dashboard.options.darkThemeCheckbox": "Use dark theme",
        "kbn.dashboard.options.hideSearchBarCheckbox": "Hide search/filter bar"
      }
  2. Rename the file to <locale_name>.json, where the <locale_name> is one of the locale names in the above table.

  3. Open the investigate.yml file and make sure that the i18n.locale value is set to <locale_name>. If the i18n.locale key is not already in the investigate.yml file, add the key and save the file.

  4. In the <locale_name>.json file, replace the text strings in the messages object with translated text strings.

Do not change the keys or any of the parameters inside the curly brackets.

To translate a string that can be either singular or plural, refer to Elastic’s i18n guidelines for pluralization.

Localizing custom plugins

Before you begin, refer to the Kibana I18n Tools guidelines and follow the instructions to add the keys and default messages.

After you add the keys and default messages, complete the following steps:

  1. To initialize the i18n provider, add the following statement to the root JavaScript file of the plugin (app.js or index.js):

    import ui/i18n;

  2. At the root of your plugin, create a folder called translations and a file called .i18nrc.json. Both the folder and the file can remain empty for now.

  3. Install the plugin in siren-investigate as usual.

  4. When the installation is complete, go to the siren-investigate folder, open a Terminal window, and execute the following command:

    • Linux and MacOS:

      node/bin/node scripts/i18n_extract --path siren_plugins/<your_plugin_name> --output-dir siren_plugins/<your_plugin_name>/translations
    • Windows:

      node\node scripts\i18n_extract --path siren_plugins\<your_plugin_name> --output-dir siren_plugins\<your_plugin_name>\translations

      If no errors are found, the command creates an en.json file in the new translations folder of your plugin. This file contains all the keys that were added to the plugin to support translations.

  5. Replace the values in the messages object in all of the files and save the file as <locale_name>.json.

  6. Open the .i18nrc.json file in the plugin and add the following object:

    {
      "translations": [
        "translations/your_locale_name.json"
      ]
    }
  7. Restart the server.

  8. Start the application to see the translated strings in the user interface.

To avoid problems starting the application, ensure the following:

  • The translations folder in the core application and in every plugin contains a <locale_name>.json file.

  • Both the .i18nrc.json file and the <locale_name>.json file exist.

  • The translations array in the .i18nrc.json file contains the string translations/<locale_name>.json. If the string is not there, add it.