Page Properties | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||
Resources & Remarks Modification History
|
...
- The clients are showing static labels coming from the client source project that includes the framework library. Both parts are handling files for each supported language containing keys and the labels showing up for the language the user has set up in the settings. The reference client is delivered with language files for English and German named en.json and de.json. Take the files of one language of the client project as well as of the framework library, create a new language file (e.g. ja.json e.g. for Japanese) and put all keys into that file. Translate the labels and place the new language file beside both existing ones as described below.
- Configure the main.json configuration file and add the new language so the user can select it in the settings area of the client.
- The clients are showing dynamic labels (custom labels) as well. These are set up in the language files that support localizing technical names that are given in the configured schemas and forms. These language files are persisted in the config service using specific REST endpoints of the Web-API Gateway. There are two groups of language files. One group contains all globally used technical names that are part of the system schema as well as of the app schemas. After setting up a new environment the language files for resource en= English and de = German are persisted and containing all system-specific technical names like 'system:document' and 'system:folder'. The other group contains the technical names that are configured in a tenant schema if given.
You need to fetch the one global language file (system) and if given a tenant-specific one, let them be translated for the wished new language and store them as described below.
...
Setting up the static labels
todos: describe where to find the language files in the client project: https://www.npmjs.com/package/@yuuvis/project
and where in the framework library: https://www.npmjs.com/package/@yuuvis/framework
Setting up the dynamic labels
todos:
For the system:
GET e.g. the English language setting via curl -X GET "https://mydomain/api-web/api/admin/resources/text" -H "accept: application/json" -H "Accept-Language: en" for getting a JSON-based response.
POST e.g. a Japanese language setting via curl -X POST "https://mydomain/api-web/api/admin/resources/text/ja" -H "accept: */*" -H "Content-Type: application/json" -d "{all keys that are give}"
For a specific tenant the user is logged in for.
GET e.g. the English language setting via curl -X GET "https://mydomain/api-web/api/admin/resources/text" -H "accept: application/json" -H "Accept-Language: en" for getting a JSON-based response.
POST e.g. a Japanese language setting via curl -X POST "https://mydomain/api-web/api/admin/resources/text/ja" -H "accept: */*" -H "Content-Type: application/json" -d "{all keys that are give}"
Notice: While creating a new tenant and setting up its specific tenant schema all the relevant dynamic language files containing the specific technical names have to be prepared as well.
Summary
Info | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||
Read on
|