In applications built with the Thinkwise Platform, the GUI supports multi language translations of objects like menu’s, entities, columns, tasks, and so on. However, the data is not multi language (yet). For example, when you have a table Products, the name of the product can be “Car”. This is fine when you’re English speaking, but when you’re French, it would be nice if you would see ‘Voiture’.
The data to be translated resides in your application, not in the Thinkwise Platform. Therefore it is hard (and not desirable) to solve this challenge in the Thinkwise Platform itself.
In this solution you will find functionality to translate one or more values per record. This functionality automatically generates:
- Tables in which you can translate one or more values of records.
- Lookup queries which retrieve lookup values in the language of the user.
The solution for multi-language data consists of one Dynamic Model script. This script generates translation tables for every table which has columns with a TAG which name is stored in variable @translation_tag_id.
The new tables are constructed as follows: Table name = Table name + value in @translation_post_fix
You must have a language table, defined by yourself. The name of this table must be stored in variable @language_tab_id. The primary key column of this table must be assigned to: @language_pk_col_id. This script assumes this table has one primary key column. If you have more primary key columns in this table, then you have to modify this script.
A user table is needed in which the login and the language is defined. The name of the table must be stored in @user_tab_id. The primary key column of this table must be assigned to: @user_pk_col_id. This script assumes this table has one primary key column. If you have more primary key columns in this table, then you have to modify this script. Finally, this table needs a foreign key to the table in @language_tab_id. The name of the foreign key column must be the same as the one in @language_pk_col_id.
- Add the script to you dynamic model
- Create a table for users
- Create a table for languages
- Link the languages table to the user table
- Create a tag with the name stored in @translation_tag_id
- Add tag @translation_tag_id to all columns you wish to be translated.
- Enter your names in variables:
In this example you’ll see a very small application. It has users, customers, products and materials, and finally order with lines. There is one product named Car. It is translated in French as Voiture. At user level the language is changed from English to French. The result is that in Order Line the value Car is automatically changed to Voiture, while in the database the product stays the same.