How to automatically translate survey depending on answer instead of dropdown menu | XM Community
Solved

How to automatically translate survey depending on answer instead of dropdown menu

  • 21 December 2021
  • 4 replies
  • 213 views

Userlevel 7
Badge +37
  • Level 4 ●●●●
  • 401 replies

(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.

icon

Best answer by KimothiSaurabh 31 December 2021, 09:55

View original

4 replies

Userlevel 4
Badge +18

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('~')[2];
if(choiceNum==1)
{
jQuery("select[id='Q_lang']").val('EN');
}
       if(choiceNum==2)
{
jQuery("select[id='Q_lang']").val('FR');
}
jQuery("select[id='Q_lang']").trigger( "change" );
    }
  }
});

This is the language question:-
image.png

Userlevel 7
Badge +37

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.

Badge +1

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

Userlevel 7
Badge +37

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