Add a Custom Language to the mpmX Template App Multilanguage |
Scroll Previous Topic Top Next Topic More |
mpmX natively supports a large number of languages, enabling the cross-regional use of mpmX apps. In addition to German and English, mpmX also supports French, Spanish, Italian, Chinese (simplified) and Turkish, among others. Other languages can be developed and provided individually on request.
The supported languages affect the environment as well as the mpmX apps and the developed dashboards.
This part of the documentation refers only to the mpmX 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 mpmX Template App makes use of the MasterItems_mpmX-file and the mpmX_Translation-file. Both files can be edited to aggregate new translations or change the displayed texts:
•mpmX_Translations.csv
•MasterItems_mpmX.csv
Control, that the table InputTranslations 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 |
DE |
This column holds the German translation for the object. |
EN |
This column holds the English translation for the object. |
ES |
This column holds the Spanish translation for the object. |
DE_Description |
This column holds the German translation for the description of the object. |
EN_Description |
This column holds the English translation for the description of the object. |
ES_Description |
This column holds the Spanish translation for the description of the object. |
In this example the Measure_Label_MasterItemID_1130 has the name “Automation Rate”. In the mpmX_Translations.csv the entry should be like the following:
ID |
TextObject |
EN |
DE |
ES |
EN_Description |
DE_Description |
ES_Description |
197 |
Measure_Label_MasterItemID_1130 |
Automation Rate |
Automatisierungsrate |
tasa de automatización |
The Automation Rate is calculated based on the field RealUser. |
Automatisierungsrate ist berechnet auf Basis des Feldes RealUser. |
La tasa de automatización está calculada basado en el campo RealUser. |
•_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 mpmX_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 mpmX_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)
)
Please read here about the num(), date() and timestamp() functions of Qlik in case of questions.
The mpmX_MasterItems.csv for the previous Automation Rate Example contains the following:
_MasterItemID |
_MasterItemLabel |
_MasterItemName |
_MasterItemExpression1 |
_MasterItemDescription |
ScenarioFlag |
SourceSystem |
_MasterItemFormatType |
1130 |
only({<TextObject = {Measure_Label_MasterItemID_1130}>} $(mvSelectedLanguage)) |
%Automation rate |
num( |
Measure_Label_MasterItemID_1130 |
mpmX |
Custom |
Measure Expression |
After this, you import the master items as usual.