Hello,
I've input the flatpickr into the header in my project and the question code as directed from this reply from Tom G on the following post https://www.qualtrics.com/community/discussion/11756/change-language-using-flatpickr.
I'm still unable to view the french months. Any help would be appreciated.
Hi there, if you still need, I was able to get this to work on my end by adapting the code in this thread. I included Spanish also just to see how adding more languages would go. For your survey, first head to the General section of the survey's Look & Feel and add the below to the survey's Header:
Then, head over to the Translations section of the Builder and add "French (Canada)" as a language.
Finally, create a Text Entry question and add the below to the question's JavaScript:
Qualtrics.SurveyEngine.addOnload(function()
{
/*Place your JavaScript here to run when the page loads*/
if ("${e://Field/Q_Language}" == "EN") {
lang = "default";
}
if ("${e://Field/Q_Language}" == "ES-ES") {
lang = "es";
}
if ("${e://Field/Q_Language}" == "FR-CA") {
lang = "fr";
}
});
Qualtrics.SurveyEngine.addOnReady(function()
{
jQuery("#"+this.questionId+" .InputText").flatpickr({
"locale": lang,
dateFormat: "Y-m-d",
maxDate: "today"
});
});
https://community.qualtrics.com/XMcommunity/discussion/comment/52094#Comment_52094 You don't need if statements to set the variable lang.
"${e://Field/Q_Language)".substr(0,2).toLowerCase();does it for you. The OP probably didn't load the l10n files.
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.