Localization¶
pSeven Enterprise supports UI localization, which allows you to translate its UI into your local language, as well as to provide users with a multilingual UI by adding more translations.
To add a UI language, you need to upload the UI translation files
to the localization
folder in the pSeven Enterprise shared data storage.
For users, the language switch is automatic:
pSeven Enterprise detects the language from browser settings (1)
and displays UI in that language if the translation files for it
are found in localization
.
If they are missing, the UI falls back to English.
- To detect language, pSeven Enterprise checks the
Accept-Language
HTTP header sent by the user's browser and picks the first language from the list in this header. The order of that list is the order of the user's preferred languages as set in their browser. Usually, the first language there is the same as the OS interface language. Most users never change this default; in many browsers, this setting is even hidden from users.
You can add or update translation files at any time, without stopping pSeven Enterprise. This doesn't interrupt users.
For quality localization, translators need access to the pSeven Enterprise UI and need to be able to upload translation files themselves, so they can test translations directly in the UI. It's advisable to create a separate pSeven Enterprise Express deployment for translators. It can be set up with minimal resources since translators don't need to run production workflows and other resource-intensive tasks.
Adding languages¶
Localization files - sources in English and translations - are stored
in the localization
folder inside the pSeven Enterprise shared data storage ({shared data}
).
To add a language, send the source files to translators,
receive the translated files from them, and add these files to {shared data}/localization/
.
Names of localization files and folders use the ISO 639-1 two-letter language codes.
For instance: en.json
for English (source), zh.json
for Chinese, fr.json
for French.
Shared data storage location
In pSeven Enterprise Express, {shared data}
is a folder in the VM filesystem.
It has a fixed path: /Storage/pSeven/Shared
.
In a Kubernetes deployment, {shared data}
is a folder on the NFS server,
specified by storage.shareddata.nfs.path
in values.yaml
.
You can use helm get values
to check the values in your deployment;
usually:
helm get values pseven-rl -n pseven-ns -o yaml > values.txt
You can also use exportfs -av
on the NFS server to check the paths
to exported directories, for instance:
$ exportfs -av
exporting *:/var/pSeven/SharedData
exporting *:/var/pSeven/WorkspaceData
exporting *:/var/pSeven/UserData
When you install pSeven Enterprise, it writes the English language files
to {shared data}/localization/
.
These files are the translation sources:
localization/en.json
- UI texts: panes, dialogs, buttonslocalization/locale/en/LC_MESSAGES/django.po
- log messages
These files use common formats supported by the majority of computer aided
translation (CAT) tools for import and export:
en.json
is a simple key-value JSON, django.po
is a gettext file.
Translations must be provided in two files, maintaining the same formats.
Copy the translation files to localization/{lang}.json
and
localization/locale/{lang}/LC_MESSAGES/django.po
where
{lang}
is the ISO 639-1 two-letter language code.
For instance, Chinese localization files would be:
localization/zh.json
- UI textslocalization/locale/zh/LC_MESSAGES/django.po
- messages
To test a localization, change your system UI language to the one you're testing, or set it as the most preferred language in your browser. Sign in to pSeven Enterprise as a user; the UI should switch to the new language automatically. The translated UI texts are updated instantly, and the update of translated messages usually takes a few minutes.
If you see the default English UI after the sign-in,
check the Accept-Language
headers sent by your browser.
The language you're testing should be the first in the list in these headers.
The language code in the header must comply with ISO 639;
however, it doesn't have to be a two-letter code - for example,
Chinese can be specified as zh
, zh-CN
, or zh-HK
.
Updating translations¶
When you upgrade to a new version of pSeven Enterprise,
the English sources in {shared data}/localization/
are also updated.
This update maintains compatibility with translation memory (TM) in CAT tools:
adds new and updated translation segments (keys),
preserved existing segments that didn't change.
To update a localization,
send the new versions of the English sources to translators,
receive the updated translation files, and
save them to {shared data}/localization/
, replacing the existing ones.
Translations can be updated at any time:
this doesn't require stopping pSeven Enterprise and doesn't interfere with users.
The {shared data}/localization/
folder also stores backup copies of
the English source files from previously installed versions,
created during version upgrades.
After an upgrade, you may delete these backups if necessary.
Sign-in page localization¶
The user sign-in page is part of the built-in authentication service, Keycloak. It uses Keycloak's built-in localization, which is configured separately.
- Sign in to Keycloak as an administrator.
- Open settings and go to the Realm settings section.
- On the Localization tab, enable Internationalization.
- Select the languages you need from Supported locales and save your settings.