Qlik Community

Qlik Sense Integration, Extensions, & APIs

Discussion board where members can learn more about Integration, Extensions and API’s for Qlik Sense.

Highlighted
master_t
New Contributor III

Localizing a Qlik Sense extension

I'm developing a Qlik Sense extension, and I would like to support multiple languages so that the user can cose one from the extension's property panel.

I can do this easily for the text in the extension itself (just check the layout object to find the selected language and output the correct text in the html template)

However, I don't know how to do this for the properties panel of the extension. When you write an extension you must return the "definition" object (which defines the items in the properties panel) but that happens BEFORE the first call to paint() (odviously). So I have no idea how to provide translated labels for m custom properties in the properties panel, since I don't have access to the layout object ad this point.

Is there any way around this?

Labels (1)
1 Solution

Accepted Solutions
ajaykakkar93
Contributor III

Re: Localizing a Qlik Sense extension

i think you can do this,
Solution is use show property to hide show if your layout has a lang Prop so that u can switch/hide/change the test as per requirement
Regards & Thanks,
Ajay Kakkar
ajaykakkar93@gmail.com
3 Replies
ajaykakkar93
Contributor III

Re: Localizing a Qlik Sense extension

i think you can do this,
Solution is use show property to hide show if your layout has a lang Prop so that u can switch/hide/change the test as per requirement
Regards & Thanks,
Ajay Kakkar
ajaykakkar93@gmail.com
master_t
New Contributor III

Re: Localizing a Qlik Sense extension

Thanks, you pointed me in the right direction.

However, instead of using "show", I directly assigned a function to the "label" attributes of each property. With that function I can return a string dynamically:

myProp: {

   ref: config.myProp,

   type: string,

    label: function(layout) {return layout.config.language === 'EN' ? "something" : "something else";}

}

 

this seems to work well. Thanks again for giving me the idea, even tho I didn't use "show" in the end it pointed me in the right direction,

ajaykakkar93
Contributor III

Re: Localizing a Qlik Sense extension

anytime..
Regards & Thanks,
Ajay Kakkar
ajaykakkar93@gmail.com