Disable i18n translation in dialogs | Community
Skip to main content
gabrielav200407
Level 2
March 7, 2016
Solved

Disable i18n translation in dialogs

  • March 7, 2016
  • 13 replies
  • 4937 views

Hello,

I would like to disable i18n translation in dialogs. I have the situation where I load the options for a dropdown dynamically, from a servlet. The options are exactly how they should appear in the dropdown. However, CQ seems to do some additional translation for the options. Is there a way to disable this?

Thanks

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by smacdonald2008

For 5.6 - overlay that and replace use of that without that logic that translates it. 

Can you post a screenshot too. I have never heard of this happening before. 

13 replies

gabrielav200407
Level 2
March 7, 2016

After more debugging, it looks like the translation happens in the setOptions function of Selection.js, line 419:

for (var i = 0; i < options.length; i++) { var o = options[i]; storeConfig.data.push([o.value, o.text, CQ.I18n.getVarMessage(o[CQ.shared.XSS.getXSSPropertyName("text")]), o.qtip]); }

 

I am using CQ 5.6. 

smacdonald2008
smacdonald2008Accepted solution
Level 10
March 7, 2016

For 5.6 - overlay that and replace use of that without that logic that translates it. 

Can you post a screenshot too. I have never heard of this happening before. 

gabrielav200407
Level 2
March 8, 2016

Sure,

So here is the dialog:

<?xml version="1.0" encoding="UTF-8"?> <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" jcr:primaryType="cq:Dialog"> <items jcr:primaryType="cq:Widget" xtype="tabpanel"> <items jcr:primaryType="cq:WidgetCollection"> <app-properties jcr:primaryType="cq:Panel" title="App Properties"> <items jcr:primaryType="cq:WidgetCollection"> <type jcr:primaryType="cq:Widget" fieldLabel="App Version" name="./version" type="select" defaultValue="" xtype="selection" optionsRoot="." optionsTextField="value" optionsValueField="key" options="$PATH.versions.json"/> </items> </app-properties> </items> </items> </jcr:root>

I've hardcoded the options values in the versions.jsp file to simplify testing. Bellow are the results of $PATH.versions.jsp:

Bellow is the setup of the i18n label:

Bellow is the code snippet that does the translation:

for (var i = 0; i < options.length; i++) { var o = options[i]; storeConfig.data.push([o.value, o.text, CQ.I18n.getVarMessage(o[CQ.shared.XSS.getXSSPropertyName("text")]), o.qtip]); }

And here is the result:

 

Yeah, I was thinking of doing the same as you suggested i.e. overlay the Selection.js file.