Enable UI languages
For censhare Client and censhare Web
Introduction
The user interface of censhare Client, censhare Admin Client and censhare Web is available in several languages. The standard distribution of censhare is delivered with the following languages:
- English (EN)
- German (DE)
- French (FR)
- Italian (IT)
English and German are enabled by default. The other languages are available without any restrictions and can be enabled as described in this article.
Available languages are controlled in the Master data in the censhare Admin Client.
Adding custom languages/locales that are not available in the standard distribution is not supported.
Add locale
- Log into the censhare Admin Client.
- Go to Configuration > Modules > Administration > Locales and activate Add/Delete Locale.
- Update the server configuration.
- From the Server Actions menu, select Add/Delete Locale.
- Under Action, select Add.
- In the Locale name field, enter the ID of the desired language: one of fr, it
- Under Locale for default values, select a locale to be used if censhare does not find a localized key in the Master data. We recommend that you always select en here.
- To run the server action, click OK. censhare creates the database columns for the new language.
To remove a language, select the action Remove. Select the desired language from Locale name. Click OK.
Database update info
A db-schema.patch
file is created in the following location: censhare-Custom/censhare-Server/app/config/. Depending on the executed actions, the following tags will be added into the db-schema.patch file:
- Remove - <p:remove>
- Add - <p:add>
Add language to the server's general configuration
- In the censhare Admin-Client, open the Configuration/Server/General configuration. If a custom configuration already exists, open it.
In the Locales section at the bottom of the dialog, click and add the language code of the language that you want to enable.
To save the configuration, click OK.
Update the server configuration. If necessary, synchronize the remote servers.
Populate the master data language columns
The correct localized values for the new language columns are stored in the insert-data.xml file.
- Open Terminal.
- Change to the censhare-Server directory.
Execute the following script:
CODEbin/DatabaseUpdate.sh <your-server-name> update
Go to the censhare Admin Client.
From the Server Actions menu, select Reload data cache.
To verify the results: In censhare Admin Client ,open any localized master data table, for example, Asset types. Open any standard record, for example type Group and check that an additional Name row for the newly added language is displayed. Also ensure that the name is localized correctly. Example: Name [fr] Groupe
Build webpack bundles for your language
For every language, a webpack bundle must be created.
Prerequisite
Yarn must be installed on your test or deployment system. Build the webpack bundles there and copy them to the production server in a manual step.
For more information on webpack handling, see Build frontend bundles macos local (partner login required).
Steps
- Open the following file in a text editor: censhare-Client5/web/censhare.json. The file is in JSON format.
- Enter the required languages into the file.
- Then open Terminal.
- Change to the censhare-Client5/web directory.
- Execute the command:CODE
yarn cs5 release
This command builds the webpack bundles for all languages that are defined in the file censhare.json. The result files can be found in directory censhare-Client5/web/dist/censhare5.
The new locale is now effective. No restart of any censhare services is required. Copy the webpack bundles to the production system as required.
Result
System languages that you added can be selected in the censhare Client in the File ► Locale menu, and in censhare Web in the user preferences in the User interface language field. Content languages that you added are available in any localized asset property and in censhare Web in the user preferences in the Preview language field.