Translate the MPM Template App Multilanguage to a Custom Language |
Scroll Previous Topic Top Next Topic More |
This part of the documentation refers only to the MPM Template App April 2020 Multilanguage. |
The multilanguage function includes all text translations, proper dates and number formats according to the language selected. The language can be selected via button in the front end.
The multilanguage function in the MPM Template App makes use of the MasterItems_MPM-file and the MPM_Translation-file. Both files can be edited to aggregate new translations or change the displayed texts:
•MPM_Translations.csv
•MasterItems_MPM.csv
Control, that the table InputTranslations (line 11-17) can be loaded from it's source. Maybe you will need to adapt the library it is read from. |
This file contains the translations to each language. It includes a column with the object name that you would like to translate, columns with the languages and an ID to identify the objects easily. At the moment, only English and German is available, therefore you have columns for DE and EN. You can add more languages, that will be available in the apps front end, by creating new columns with the translation to the respective language. The columns at the actual template are:
Field Name |
Explanation |
ID |
A unique identifier for the text object |
TextObject |
A speaking identifier, that will be used in the front ends label within the only-expression.
The naming convention for Master Items is the following: <Measure|Dimension>_Label_MasterItemID_<MasterItemID>.
For chart titles the naming convention is: <Sheetname>_<ChartType>_<Title|Text|Subtitle|Footnote>_Number
A text object can be: •Instructions in a Text Box •Chart titles (all kind of charts) •Chart subtitles •Chart footnotes •Displayed message in a chart with calculation condition •Sheet names •Labels of Measure and Dimensions (master items) •Variables for number and date formatting |
EN |
This column holds the English translation for the text object. |
DE |
This column holds the German translation for the text object. |
In this example the Measure_Label_MasterItemID_1130 has the name “Automation Rate”. In the MPM_Translations.csv the entry should be like the following:
ID |
TextObject |
EN |
DE |
197 |
Measure_Label_MasterItemID_1130 |
Automation Rate |
Automatisierungsrate |
•_MasterItemLabel: steers the translation of any text displayed in the front end. Therefore it holds a formula instead of a clear name. This formula makes use of the MPM_translation.csv, which is why the _MasterItemLabel now holds an expression as the following:
only({<TextObject = {TextObject}>} $(mvSelectedLanguage))
The {TextObject} has to be replaced with the exact name that was given to MasterItem in the column TextObject of the translations file. Refer to the example below. |
•_MasterItemExpression: steers the number or date formats (e.g. adapting from comma to point notation when switching from German to English). Every measure expression has to be num- or date-formatted by using formats, that are held in 7 defined variables. These variables are defined in the MPM_translation file for German and English. To aggregate formats for another language, adapt the variables in the translation-file.
omvDateFormat
omvDecimalFormat
omvNumFormat
omvNumFormatPercentage
omvNumFormatWithoutDecimals
omvThousandSepFormat
omvTimestampFormat
You have to use them in combination with your measure expression as the following.
Num(
Sum(MyMeasure),
,$(mvNumFormatWithoutDecimals),
$(mvDecimalFormat),
$(mvThousandSepFormat)
)
Or
Date(
MyDate,
$(mvDateFormat)
)
Please read here about the num(), date() and timestamp() functions of Qlik in case of questions.
The MPM_MasterItems.csv for the previous Automation Rate Example contains the following:
_MasterItemID |
_MasterItemLabel |
_MasterItemName |
_MasterItemExpression1 |
1130 |
only({<TextObject = {Measure_Label_MasterItemID_1130}>} $(mvSelectedLanguage)) |
%Automation rate |
num( |
After this, you import the master items as usual.