How to automatically translate survey depending on answer instead of dropdown menu | XM Community
Skip to main content

(There is already a question for this but apparently something has changed so the previous answer no longer works).
I have a survey that is translated. However, we cannot show the menu dropdown to the recipient; we need to be able to set the Language within the survey proper.

  • Attempts to set or re-set Q_lang via the survey flow (which is the need) does not have any impact; Q_lang appears to only work if it can be applied to the URL.

  • Setting Q_Language similarly has no impact.

  • Setting Language in the survey flow is not viable; Qualtrics no longer allows language to be set in this way.

Does anyone have another way to do this? It has to be done within the survey & survey flow so that logic can be applied to the settings.

CarolK - You can place below Javascript code in that language question and it should work. Please update if-else lines as per language available in that question.
Qualtrics.SurveyEngine.addOnReady(function()
{
/*Place your JavaScript here to run when the page is fully displayed*/
 this.questionclick = function(event,element){
    if (element.type == 'radio')
    {
      var choiceNum = element.id.split('~')t2];
if(choiceNum==1)
{
jQuery("select id='Q_lang']").val('EN');
}
       if(choiceNum==2)
{
jQuery("selectbid='Q_lang']").val('FR');
}
jQuery("select    }
  }
});

This is the language question:-
image.png


I must be doing something wrong. This seemed to work, until I put the Display logic onto the language options (I actually have 5 languages in the survey, but all options are not available to all recipients). Then even after I removed that logic again, I can't repeat the test and have it work. So I've messed something up. But thank you KimothiSaurabh that puts me on the trail of a solution.


CarolK
Maybe try a pre-survey that automatically redirects with the Q_Language code in the URL to the main survey (in order to pass that language variable as embedded data)? I suggested that approach in another question.
How to automatically translate survey depending on answer instead of dropdown menu — Qualtrics Community


Thank you Lon -- but we would never use a separate survey (and thus twice as many completes on our license) in this way.


Leave a Reply