IsRowId
General
A set of DB tables is translated using the ISROWID, the UEBERSETZUNG table and the language dependent views. The structure of the view names is as follows: Table name + "_" + Id of the language. The actual translation can be found in the "Uebersetzung" table.
The structure of the "Uebersetzung" table is as follows:
Column |
Primary key |
Description |
TABELLENID |
|
Table Id (from IS_TABELLENNAME.TABELLENID ) |
ISROWID |
|
Foreign key to the entry to be translated for the table |
LANGUAGE |
|
|
VALUE_0 |
|
Value for first string field to be translated |
VALUE_1 |
|
Value for second string field to be translated |
VALUE_TEXT_0 |
|
Value for the long text to be translated |
Warning
No translation view is created for the German language.
Warning
An "insert statement" and a change of a primary key by the "save" method of a repository cause a trigger to be fired that sets the IsRowId. Therefore, changes that affect a primary key must be done manually with an "update statement". This also means that the developer cannot set the IsRowId himself.
Server
Repositories
Implementation
The repositories of the domain objects based on tables that work with IsRowId are not derived from the default repository class, but from the MultiLangRepository class. When implementing a new repository that derives from MultiLangRepository, make sure that the domain object has the "IMultiLangObject" interface implemented and that the abstract field variables "TableId", "Value0" and "ValueText0" are set. "TableId" is assigned the TableId from IS_TABELLENNAME. "Value0" and "ValueText0" are assigned the names of the variables to be written to "Value_0" and to "Value_Text_0".
Warning
The names assigned to the values are case sensitive.
Functions
Name |
Input parameter |
Output |
Description |
GetTranslated |
Id: Key to the object to be translated Fields: Specify from which field the translation should be |
string |
With this function you get the name or the long text from the appropriate user language |
Delete |
Obj: Entity to be deleted |
/ |
The "Delete" function from the base class is overwritten. In addition to the entity, all associated translations are also deleted. |
SaveTranslation |
Id: Key to the object whose translations are to be saved Value0: The value to be stored in Value_0 in the "Uebersetzung" table ValueText0: The value to be stored in Value_Text_0 in the "Uebersetzung" table |
/ |
This method can be used to save translations in the "Uebersetzungen" table. The current user language is always used as the language. Since the function is overloaded, either only the value to be stored in "Value_0" can be specified or both values ("Value_0" and "Value_Text_0"). |
Controller
For the view models that are sent to the client, you must take care that the view model has an IsRowId and additional parameters for the German translations. For the storage methods you have to take care if the user language is German or another language, because the German translation is stored in the actual table and the others in table "Uebersetzung".
Client
Entity model
The entity model needs variables for the German designations and long texts and a variable for the IsRowId.
EditTranslations
Implementation
The following props must be set during implementation:
Name |
Description |
ref |
Is an object reference is on the dialog |
label |
The text that the dialog has as a heading |
saveGerman |
Is a function that passes a value of type string, this is the edited German translation. Furthermore, the function returns the name of the memory target. Here it is to be indicated, what should happen with the edited German designation or text, if the dialog is closed. |
Access
The dialog is opened with the function "openDialog" of the reference. This function expects the following parameters:
Name |
Type |
Description |
isRowId |
number(Integer) |
The IsRowId of the opened entity |
tabellenId |
number(Integer) |
The TabellenId to which the opened entity belongs |
target |
"value_0" | "value_1" | "value_text_0" |
The column in the "Uebersetzung" table in which the non-German translations are to be saved |
germanvalue |
string |
The German value, this is not stored in the table "Uebersetzung" but in the origin table |