Translation of survey with hidden variables and custom Javascript

I am translating a survey that includes a substantial amount of hidden variables and free format questions with custom Javascript and html tables which leverage the BetterLighthouse Library (for modules including select and check box questions).

I am familiar with using the Multi-language survey tool and importing the translation which uses the language div class to display text conditionally based on a pass through language variable (and have gotten it to work in the past with simpler surveys). Unfortunately there appear to be substantial conflicts with both the hidden variables and the free format questions.

I have noticed in the past that for custom javascript validation the div class approach doesn't work but it does work with the workaround below. However, I have tried this unsuccessfully (and it wouldn't be appropriate for an free forma question HTML head anyhow). For the hidden variable question I tried both removing the div class (e.g. making it untranslated) and that also did not help.

Guidance on translating complex surveys like this would be appreciated

var lang = [% LANG %];

if (lang == '2') {

strErrorMessage = "[translated text];"

}

else {

strErrorMessage = "[original text];"

}

for creating a survey

1 reply