SBOM Workbench is multi-language enabled. This is done using the internationalization-framework i18next. See official documentation for more details.
There are currently 2 languages:
Language | Language Code |
---|---|
English | en |
Spanish | es |
Chinese | zh |
The following steps must be followed to add a new language. For example let's add a translation for the French language:
- Add new lenguage to i18n module. In
src/shared/i18n/index.ts
add a new entry inAppI18n
specifing the lenguage code in ISO 639-1 format and the original name:
private static languages: Record<string, string> = {
'en': 'English',
'es': 'Español',
'fr': 'Français', // -> the new entry!
}
- Copy
assets/i18n/en
folder (and its contents) and rename to the new lenguage code:
- Replace all values into the translation files. Each file represents a namespace that has to be translated:
Button.json
{
"NewProject": "Nouveau projet",
"ImportProject": "Importer un projet",
"Continue": "Continuer",
"Save": "Sauver"
}
- Add the new language to the table in this readme
You can see the progress of your translation as you go. For this you need to start the application in development mode. See installation and starting guide.
Once you have the application running in development mode, you can gradually change the translation files to see the changes reflected in the app:
- Select the new language in Settings (File -> Settings). Reboot is required.
- Change any value in your translation files.
- Reload app (View -> Reload)
- Open Translation Management to shows an overview of your translations in a nice UI. Check which keys are not yet translated. (View -> Open Translation Management)
You can help in SCANOSS translations submitting PR directly changing all files described in this guide. For more information see the Contributing Guide and Code of Conduct.