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. You can use one of the supplied pre-translated languages or supply your own translations. If you have additional custom plugins, you must also enable internationalization support for them.
Pre-translated files for the following languages ship with Siren Platform. These files are in the translations folder, and are available out-of-the-box.
| 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 to a pre-translated language
To localize Siren Investigate to a pre-translated language, complete the following steps:
-
In the
translationsfolder, locate the pre-translated language file. -
Open the
investigate.ymlfile and set thei18n.localevalue<locale_name>to the language you want to use. If thei18n.localekey isn’t already in theinvestigate.ymlfile, add the key and save the file. -
Restart the application to see the translated strings applied in the interface.
Modifying pre-translated strings
You can modify any of the translated strings to better suit your dialect or industry’s terminology.
To modify any of the pre-translated terms in the language files, complete the following steps:
-
In the
<locale_name>.jsonfile, replace the text strings in themessagesobject with your modified version of text strings. -
Make sure that the
i18n.localevalue is set to<locale_name>in theinvestigate.ymlfile. If thei18n.localekey isn’t already in theinvestigate.ymlfile, add the key and save the file. -
Restart the application to see your modified terms applied in the interface.
|
|
If you want to add new keys, contact Siren at https://support.siren.io/ to make a suggestion. |
Applying a custom translation
If you want to use a language that’s not one of the pre-translated languages, you can generate a translation file and replace the values with your own translations.
To apply custom translations, complete the following steps:
-
In the
siren-investigatefolder, 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 translationsThis command generates a file called
en.jsonin thesiren-investigate/translationsfolder. Theen.jsonfile contains amessagesobject, 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" } -
-
Rename the file to
<locale_name>.json. -
Open the
investigate.ymlfile and make sure that thei18n.localevalue is set to<locale_name>. If thei18n.localekey isn’t already in theinvestigate.ymlfile, add the key and save the file. -
In the
<locale_name>.jsonfile, replace the text strings in themessagesobject with your translated text strings.
|
|
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:
-
To initialize the
i18nprovider, add the following statement to the root JavaScript file of the plugin (app.jsorindex.js):import ui/i18n; -
At the root of your plugin, create a folder called
translationsand a file called.i18nrc.json. Both the folder and the file can remain empty for now. -
Install the plugin in
siren-investigateas usual. -
When the installation is complete, go to the
siren-investigatefolder, 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.jsonfile in the newtranslationsfolder of your plugin. This file contains all the keys added to the plugin to support translations. -
-
Replace the values in the
messagesobject in all of the files and save the file as<locale_name>.json. -
Open the
.i18nrc.jsonfile in the plugin and add the following object:{ "translations": [ "translations/your_locale_name.json" ] } -
Restart the server.
-
Start the application to see the translated strings in the user interface.
|
To avoid problems starting the application, ensure the following:
|