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
Open this file for editing:Â <SMARTIDHOME>/docker/compose/selfservice/docker-compose.yml.
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
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).
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
Remove the files for the translations you do not support.
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"
(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Â
In each file, keep only the keys you want to change, and modify their values.
Run
docker-compose up -d
if you did not run step 5 in "Extract translation files" above, else rundocker-compose restart
.
Add translation
To add a translation file for a language that is not available by default, follow these steps:
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).
Copy the contents of the extracted en.json into your newly created file in order to have the keys. (See "Extract translation files" above.)
Edit the file you created and translate the values to your language.
Run
docker-compose up -d
if you did not run step 5 in "Extract translation files" above, else rundocker-compose restart
.
Copyright 2024 Technology Nexus Secured Business Solutions AB. All rights reserved.
Contact Nexus | https://www.nexusgroup.com | Disclaimer | Terms & Conditions