Question
Can I find out language setting?
I am trying to setup a Qualtrics survey that inserts custom text into a matrix question (written by javascript). The issue is that I have multiple languages. How do I use if statements to determine the language that the survey is being completed in? I am using the drop down at the top, so it can be changed any time.
The code will be something like so (IF STATEMENTS ARE WHAT I NEED HELP WITH):
Qualtrics.SurveyEngine.addOnload(function()
{
IF Language is set to English:
var newRow = $('<tr class="Choice"><th class="Choice"><span class="LabelWrapper"><label><strong>Travel to and from School</strong><BR>Note:
walking to and from school counts as 2 times.</B></label></span></th><td class="c2 BorderColor"></td><td class="Separator2 BorderColor c3">
</td></tr>');
newRow.insertBefore ($('#QID58 tr:nth(4)'));
var newRow2 = $('<tr class="Choice"><th class="Choice"><span class="LabelWrapper"><label><strong><BR>Other Types of Physical Activity.</B>
</label></span></th><td class="c2 BorderColor"></td><td class="Separator2 BorderColor c3"></td></tr>');
newRow2.insertBefore ($('#QID58 tr:nth(8)'));
ELSE IF Language is set to French:
var newRow = $('<tr class="Choice"><th class="Choice"><span class="LabelWrapper"><label><strong>aller et retour de l'école </strong><BR>Remarque:
marcher pour aller à l'école compte pour 2 fois. </B></label></span></th><td class="c2 BorderColor"></td><td class="Separator2 BorderColor c3">
</td></tr>');
newRow.insertBefore ($('#QID58 tr:nth(4)'));
var newRow2 = $('<tr class="Choice"><th class="Choice"><span class="LabelWrapper"><label><strong><BR>Autres types d'activité physique.</B>
</label></span></th><td class="c2 BorderColor"></td><td class="Separator2 BorderColor c3"></td></tr>');
newRow2.insertBefore ($('#QID58 tr:nth(8)'));
});
Thanks,
Andrew
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
