How can I set the language based on a question in the survey? | XM Community
Skip to main content

Hi,

 

I have a survey that will have 5 languages. 

How can I use a question at the beginning to set the language of the survey? 

Thanks

Benjamin

@bjonasch If you just want to preselect one of the language options when the survey is started, you can place this JavaScript for the first question and choose the relevant language code: 

Qualtrics.SurveyEngine.addOnload(function()
{
/*Place your JavaScript here to run when the page loads*/
document.getElementById('Q_lang').value = 'DE';
});

If you want to actually ask a question “Which language do you prefer?”, then you would need some different logic. But in this case, the language dropdown should probably not be shown?

Best
Christian


Hi, thank you! 

Exactly, the language dropdown should not show and the language should be set by that question. 

 

The survey should pre-select the language of the browser of the respondent when started and then he could change it in the question if needed. No need for the language dropdown. 

Thank you!


Hi, thank you! 

Exactly, the language dropdown should not show and the language should be set by that question. 

 

The survey should pre-select the language of the browser of the respondent when started and then he could change it in the question if needed. No need for the language dropdown. 

Thank you!

This should be the expected behaviour as mentioned here.


@bjonasch,

I think this is what you are looking for.  Note: It is not intended for Simple layout.


@bjonasch,

I think this is what you are looking for.  Note: It is not intended for Simple layout.

Thank you! How do I add this to Qualtrics? 


@bjonasch,

I think this is what you are looking for.  Note: It is not intended for Simple layout.

Thank you! How do I add this to Qualtrics? 

  1. Follow the link, you will find 3 kind of code
  2. Hide the language selector by copy the CSS code to Custom CSS
  3. Paste HTML to survey answers of the language question. Change the Language code to suit you
  4. Add JavaScript to that question

Hope this helps.


Thank you


😡


Thank you

@bjonasch All thanks to @TomG man, I’m just interpreting his solution 😁


@bjonasch,

I think this is what you are looking for.  Note: It is not intended for Simple layout.

Thank you


@bjonasch,

I think this is what you are looking for.  Note: It is not intended for Simple layout.

Hi, the link does not work anymore, can you maybe post this again? 

 

Thank you!


@bjonasch,

I think this is what you are looking for.  Note: It is not intended for Simple layout.

Hi, the link does not work anymore, can you maybe post this again? 

 

Thank you!

Reposted here.


Thank you @TomG 😀


When I put in the html code as survey answers it works but shows it like this in the survey

 

“EnglishEN”

 

I used “English<span class="langCode">EN</span>” as the answer option of the question

 

How can I get rid of the “EN” shown in the option? 


The css hides the span with the class langCode:

.LanguageSelectorContainer, span.langCode { display:none; }

Make sure you’ve added that line to Custom CSS.

If that doesn’t work there is a conflict in the CSS. Not the ideal solution, but you could change display:none; to display:none !important;


Thank you!!


Leave a Reply