MLM: Underlying Assumptions
The underlying assumptions that drive how the MLM works are:
- Participants complete their REDCap surveys on their own devices, such as their own phone or laptop.
- Participants have set up their device with a default web browser, such as Google or Firefox.
- Participants always use this same device and browser for taking all of their surveys.
MLM: Under the Hood
The language an MLM enabled survey is displayed in is managed by an http cookie. Until the cookie is set, an MLM enabled survey is displayed in English, which is the default language for all surveys in all projects. What is a cookie? A cookie is a small text file that a website sends to your web browser and gets stored on your computer or mobile device. Websites use cookies to help improve your experience on their sites by remembering preferences you shared with them. Due to privacy and security considerations, the use of cookies by the REDCap website is very limited. The MLM cookie is restricted in the following ways: The cookie gets stored for a specific browser on the specific device that the participant uses when responding to their MLM enabled survey. Basically, once the MLM cookie is set, it instructs the participant's device to tell the participant's preferred web browser to display their survey in either English or Spanish.
We'll review the different options for triggering and enforcing the creation of the MLM cookie in the section that covers setting the participant's language preference. Please note that for testing purposes you will use the language widget that is embedded at the top right of every page of every MLM enabled survey to set the cookie, and in turn display the survey in English or Spanish. We'll review the widget in the testing instructions.
Critical Concept for Testing
The key consideration to keep in mind when testing MLM enabled surveys is that REDCap is not tracking the language preference for each record you create to test a survey. REDCap is tracking the language preference for the browser you're using on your work device to complete your testing.
To help understand the concept described above, review the following example of a workflow, taking note of the following caveats: 1) this workflow assumes you've never completed an MLM enabled survey on the device your using for testing, and 2) for the purposes of illustrating this workflow, we'll presume you're testing on your work laptop using Google.
- Create your first test record for testing an MLM enabled survey.
- Open an MLM enabled survey.
- By default, it will be displayed in English.
- Behind the scenes, on your work laptop, the MLM cookie will be stored for Google to track English as the language preference.
- Check the English translation of the survey as you complete it and then submit it.
- For the same record, in Google, open a different MLM enabled survey.
- It will be also displayed in English.
- This is because MLM cookie stored for Google is tracking English as the language preference.
- On the survey, use the language widget to change the language to Spanish.
- Behind the scenes, the MLM cookie stored for Google will get updated to set the language preference to Spanish.
- Check the Spanish translation of the survey as you complete it and then submit it.
- Create a new record.
- Open any MLM enabled survey.
- It will be displayed in Spanish.
- This is because the MLM cookie for Google has been reset to Spanish.
Moving forward with creating records and testing MLM enabled surveys, each time you change the language, the MLM cookie is reset to correspond to your selection, and any subsequent MLM enabled surveys you complete for any records will be presented in the last language you selected.
If you use a different browser or a different device that you've never used for MLM testing, the process of setting the MLM cookie on that device or for that browser begins again following the pattern outlined in the example workflow.
If you've previously completed an MLM enabled survey for a different project on the same device and in the same browser you use to test MLM enabled surveys for your new project, the MLM cookie will be pre-set and the survey will be presented in the last language you selected for surveys you completed for the previous project.
Testing Instructions
Using the Language Widget Tool
You'll need to use the language widget tool for testing your MLM enabled surveys.
- The widget tool is embedded in the top right corner on every page of every MLM enabled survey.
- The widget label reflects the language in which the survey is being displayed.
- Click the widget which will trigger two buttons to appear under the survey title, one for English and one for Spanish.
- Click the language you want the survey to be displayed in.
- The language will immediately switch and the buttons will disappear.
- The widget label changes to reflects changing the language in which the survey is displayed.
Create a Test Record
- Navigate to the MLM enable survey/form you want to test, and open it.
- Click
Save and Stay
from theSave options
in the top right of the page. - Click the
Survey Options
drop-down button at the top right of the form. - From the
Survey Options
at the top right of the form, select- Open survey
- OR -- Compose survey invitation
- Compose survey invitation
Compare English and Spanish Translations
- Use the language widget to switch the language the survey is displayed in between English and Spanish.
- Review all the elements of the survey for which you entered a Spanish translation, including the instructions, the title, and the fields.
- Review all the elements of the survey the MLM tool has translated, such as the required message, buttons, pop-up messages, etc.
- Close out the survey.
Complete the Survey in English
- Follow the steps above to create a test record and open an MLM enabled survey.
- If the survey is not displayed in English, use the language widget to change the language to English.
- Complete the survey so you can review the English versions of the Survey Completion message.
Complete the Survey in Spanish
- Follow the steps above to create a test record and open an MLM enabled survey.
- If the survey is not displayed in English, use the language widget to change the language to English.
- Complete the survey so you can review the Spanish versions of the submit button, the required pop up message, and the Survey Completion message.