Get Free Trial

Localization – provide example

bernard dradeou asked on February 7, 2021

Hi guys,
      whatever i have done till now i can’t get “ADOPT_ADOPTION_TYPE” being translated (see image in attach please). Can you please provide the translation file as in the example ? In jsfiddle i don’t find it. I my json translation file i have “ADOPT_ADOPTION_TYPE” : “Adoptie type”.
      Note : the translation works programmatically but it is not what i want. I want to have it like in your example. BTW i use angular 8. Programmatically : this.pivotJusticeReport.slice.rows[0].caption = this.translateService.instant(‘ADOPT_ADOPTION_TYPE’);


3 answers

Illia Yatsyshyn Illia Yatsyshyn Flexmonster February 8, 2021

Hello, Bernard,
Thank you for reaching out to us.
We would like to explain that the mentioned example demonstrates the way to localize the component itself, not the dataset. It implies UI controls, tooltips, etc. However, Flexmonster does not provide the possibility to localize the dataset itself.
For this purpose, we suggest either use the captions property of the Mapping Object to specify localized captions for each hierarchy.
Another approach is to use an already translated dataset.
We hope it helps.
Please contact us if other questions arise.

bernard dradeou February 9, 2021

Hi Illia,
    thank you for your answer. I will have a look at MappingObjects but before that please tell me how the word CATEGORY in this particular exemple is translated (see image in attach). In jsfiddle i don’t see any MappingObject.

Sans titre.png

Illia Yatsyshyn Illia Yatsyshyn Flexmonster February 9, 2021

Thank you for your feedback.
Concerning your question, please note that after pressing the button, the localized dataset is loaded to Flexmonster. It means the component loads an entirely different dataset instead of translating the existing one.
The following code snippet from the JSFiddle is responsible for reloading the dataset:

    dataSource: {
        type: "csv",
        filename: "data/data-" + lang + ".csv" //compose URL with a localized dataset
    localization: "loc/" + lang + ".json" //compose the with a localization file

We hope it helps.
Feel free to contact us if other questions arise.

Please login or Register to Submit Answer