Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Next »

Configure localizations for a custom client built with our libraries or for yuuvis® client as reference implementation.

Table of Contents

Introduction

The terms and phrases displayed by a client application based on the framework library such as our yuuvis® client as reference implementation can be localized for custom languages according to the corresponding needs. Therefore, each individual technical term used in the background can be mapped to a user-friendly localized term or phrase that will be displayed in the browser UI wherever the technical term would be present. These configurations are defined in different JSON files. There are two global localization configuration files that are available in all tenants: one for the localization of control elements provided by the framework library (e.g., buttons or error messages) and one for the localization of terms introduced via a global schema (e.g., labels for administrative fields in object forms). Additionally, each tenant has an own localization configuration file for terms introduced via its specific tenant schema (e.g., labels for metadata fields in object forms). This article describes how to define and apply all three localization configuration files to a client.



This article is written for administrators that will prepare an application based on the reference client for a new language. There are several parts that must be configured in a specific way.

Parts to be localized

If you want to localize an application you have to configure the following files and bring them into the correct place. The user interface showing by the client consists of these parts that have to be maintained differently:

  • 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.

Setting up a new environment with given schemas

In this case, you have finished configuring one environment (system plus relevant artifacts) and you want to set up a new environment including the translation files you have to bring the dynamic global language settings in place as described above.

Summary

Read on

Another Tutorial

Brief summary of the article linked.

Another Concept Article

Brief summary of the article linked.

Another interesting Tutorial

Brief summary of the article linked.

  • No labels