Skip to main content
Announcements
Qlik Community Office Hours, March 20th. Former Talend Community users, ask your questions live. SIGN UP
cancel
Showing results for 
Search instead for 
Did you mean: 
master_t
Partner - Creator II
Partner - Creator II

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
Specialist III
Specialist III

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

Please mark the correct replies as Solution. Regards, ARK
Profile| GitHub|YouTube|Extension|Mashup|Qlik API|Qlik NPrinting

View solution in original post

3 Replies
ajaykakkar93
Specialist III
Specialist III

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

Please mark the correct replies as Solution. Regards, ARK
Profile| GitHub|YouTube|Extension|Mashup|Qlik API|Qlik NPrinting

master_t
Partner - Creator II
Partner - Creator II
Author

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
Specialist III
Specialist III

anytime..

Please mark the correct replies as Solution. Regards, ARK
Profile| GitHub|YouTube|Extension|Mashup|Qlik API|Qlik NPrinting