Document toolboxDocument toolbox

Configure language in Smart ID Self-Service

This article includes updates for Smart ID 23.04.2.

This article describes how to configure the language to be used in Smart ID Self-Service, and how to add or change translations.

<SMARTIDHOME>

In this article, <SMARTIDHOME> refers to /home/nexus, but this can be different depending on the setup.

To avoid issues when updating, you should NEVER override the translation files provided within the container. Instead, you should use separate translation files that only contain the strings you want to modify.

After an update, check your modified translations, and make sure that they or their keys are still valid.

Step-by-step instruction

Configure supported languages

  1. Open this file for editing: <SMARTIDHOME>/docker/compose/selfservice/docker-compose.yml.

  2. Set the supported languages and the default language to be used if the browser language is not supported. This is done in the CONFIG_JSON environment variable, see Set properties for Smart ID Self-Service. See ISO 639-1 for a valid list of language codes.

    Set language for Self-Service

    "languages": { "supportedLanguages": [ "en", "de", "ar", "sv", "fr" ], "defaultLanguage": "en" }

Extract translation files

  1. If the container is not running, start it (it does not matter if the container ends up unhealthy and the application does not work, as long as the container is up).

  2. Copy the original files from the container to your host machine. 

    docker cp smartid-selfservice:/usr/local/tomcat/webapps/ROOT/assets/i18n <SMARTIDHOME>/docker/compose/selfservice/config/translations
  3. Remove the files for the translations you do not support.

  4. Add <SMARTIDHOME>/docker/compose/selfservice/config/translations as volume to <SMARTIDHOME>/docker/compose/selfservice/docker-compose.yml.

    - "./config/translations:/usr/local/tomcat/webapps/ROOT/assets/custom-i18n:rw"
  5. (Optional) Run docker-compose up -d to recreate the container, so that the new translation files are loaded.

Modify existing translation

To modify existing translations, edit your files in <SMARTIDHOME>/docker/compose/identitymanager/config/translations 

  1. In each file, keep only the keys you want to change, and modify their values.

  2. Run docker-compose up -d if you did not run step 5 in "Extract translation files" above, else run docker-compose restart.

Add translation

To add a translation file for a language that is not available by default, follow these steps:

  1. Create a new translation file in <SMARTIDHOME>/docker/compose/selfservice/config/translations following this naming convention <language_code>.json (See ISO 639-1 for a valid list of language codes).

  2. Copy the contents of the extracted en.json into your newly created file in order to have the keys. (See "Extract translation files" above.)

  3. Edit the file you created and translate the values to your language.

  4. Run docker-compose up -d if you did not run step 5 in "Extract translation files" above, else run docker-compose restart.

Copyright 2024 Technology Nexus Secured Business Solutions AB. All rights reserved.
Contact Nexus | https://www.nexusgroup.com | Disclaimer | Terms & Conditions