Configure Languages and Texts¶
For SEAL Operator, you can add a new language or make changes to an existing translation.
Each language configuration is stored in a separate json file in the /opt/seal/seal-operator-ui/public/assets/i18n directory. Besides the translation itself, every json file holds a Language section in Common where all available languages for the language selector are listed.
Add a New Language¶
-
Change to the directory
/opt/seal/seal-operator-ui. -
Change to the directory
additional_languages. If it does not exist yet, create it. -
Copy an existing language file from
/opt/seal/seal-operator-ui/public/assets/i18n, such asen.jsonto a new language file,<language>.json, for example,it.json. -
Translate the values of the keys in the new language file,
<language>.json. -
Add the new language to the language selection of the already existing languages. For this, create an additional language file for the already existing language
<already_existing_language>-diff.jsonin the directory/opt/seal/seal-operator-ui/additional_languages, for example,en-diff.jsonor edit the file if it already exists. Here, add the language key and the text shown in the selection to theLanguagesection. The key has to be the same as in the file name for the new language file, for example,itas key andit.jsonas file name.{ "Common": { "Language": { "language_token": "language_selection_text" } } }Example - multiple languages
{ "Common": { "Language": { "en": "English", "de": "Deutsch", "fr": "Français", "it": "Italiano" } } }Hint - merge
The diff files are merged to the language files. Therefore, specify only the differences here. The values in the diff files take priority.
-
In the configuration of the
seal-operator-uiservice, add the new language<language>to theAVAILABLE_LANGUAGESkey.env: service: operator-ui: tag: any: AVAILABLE_LANGUAGES: de,en,fr,it ... -
Close the user interface.
-
Restart the service
seal-operator-uioperator service start seal-operator-ui -
Re-open the user interface.
Change an Existing Translation¶
-
Change to the directory
/opt/seal/seal-operator-ui/additional_languages. -
Create an additional language file for the language
<language>-diff.json, for example,en-diff.jsonor edit the file if it already exists. -
Copy the section to be changed from the language file,
/opt/seal/seal-operator-ui/public/assets/i18n/<language>.jsonto the additional language file,<language>-diff.jsonand change the value.Example - change translation for
PLS_PUNCH_TYPE{ "JSON_SCHEMA": { "PLS_PUNCH_TYPE": "Punching" } }Hint - merge
The diff files are merged to the language files. Therefore, specify only the differences here. The values in the diff files take priority.
-
Reload the user interface.
Sample Language JSON File¶
{
"Common": {
"Language": {
"en": "English",
"de": "Deutsch",
"fr": "Français"
},
"Settings": "Settings FR",
"Logout": "Logout FR",
"MyTasks": "My tasks FR",
"Failed": "Failed FR",
"Pending": "Pending FR",
"Success": "Success FR",
"AddPanel": "Add panel FR",
"PanelName": "Panel name FR",
"CurrentFolder": "Current folder: FR",
"Name": "Name FR",
"FileType": "File type FR",
"FileName": "Filename FR",
"Size": "Size FR",
"Href": "File href FR",
"LastUpdate": "Last update FR",
"NoPanelSelected": "Please select a connector in order to proceed. FR",
"ServerSettings": "Server Settings FR",
"RootFolder": "Root folder FR",
"Search": "Search... FR",
"FileUpload": {
"Browse": "Upload FR"
},
"Error": {
"InvalidPanelName": "Invalid panel name FR"
}
},
"Notifications": {
"ToClipboard": "Copied items to clipboard FR",
"Creating": "Creating selected items FR",
"Moving": "Moving selected items FR",
"Copying": "Copying selected items FR",
"Created": "Successfully added entry: {{name}} FR",
"Deleted": "Successfully deleted: {{name}} FR",
"DeletedGeneric": "Items successfully deleted",
"Moved": "Successfully moved: {{name}} FR",
"AddedEntry": "Successfully added entry: {{name}} FR",
"AddedEntries": "Successfully added entries FR",
"AddedItem": "Successfully added item: {{name}} FR",
"AddedItems": "Successfully added items FR",
"Copied": "Successfully copied: {{name}} FR",
"CreateError": "Error creating: {{name}} FR",
"DeleteError": "Error deleting: {{name}} FR",
"DeleteErrorGeneric": "Error deleting items FR",
"RepoPasteError": "You have to copy repository entries first FR",
"MoveError": "Error moving: {{name}} FR",
"MoveErrorGeneric": "Error moving items FR",
"CopyError": "Error copying: {{name}} FR",
"CopyErrorGeneric": "Error copying items FR"
},
"Messages": {
"DateTime": "Date & time FR",
"ExportCSV": "Export CSV FR",
"MarkAsRead": "Click for marking the message as read FR",
"Search": "Search messages... FR",
"Source": "Source FR",
"Title": "Messages FR",
"Text": "Text FR",
"Type": {
"error": "Error FR",
"info": "Info FR",
"warning": "Warning FR"
}
},
"Plossys": {
"Details": "Details FR"
}
}