When do you need multiple languages?
When collecting data, it is often necessary to translate survey instruments into multiple languages. With XLSForms, users can write a single form in multiple languages. When collecting data or viewing data in Ona with a form that has different languages, you can toggle between them from a language dropdown.
Adding multiple languages to a form
- Add label columns for each language you would like to author your survey on the survey worksheet. In the example below, we have label::English (en), label::French (fr), and label::Swahili (sw) columns. Under each language column, add the corresponding label translation in each row. Do not leave label cells blank because the question will appear blank in the survey.
- In the choices worksheet, the label columns should have the same languages used in the survey worksheet. Repeat the first step for all the choices, adding columns and translations for each language.
Adding a hint or constraint message in a different language or adding unique media files for each language is also possible by appending ::language name to the column, for example, hint::Swahili, constraint_message::Swahili, and media::audio::Swahili. Repeat this for each language.
- Set the default language in the settings worksheet under the default_language column as shown below:
You can switch to the preferred language when conducting a survey on both Enketo webforms and ODK Collect.
To change the survey language:
- On a web form: Open the webform to view your survey. The survey will be displayed in the default language as specified in the settings worksheet of your XLSForm. You can switch to a different language by clicking on the language button on the top right of the first page of your survey.
- On ODK Collect: When using ODK Collect, the form will also be displayed in the default language. To switch to a different language, tap on the Settings button on the first page of your survey, then select Change Language settings.
You can view your data on the Table view in any of the languages defined in the XLSForm by clicking on the language button, then select a language. The labels will be displayed in the language selected as shown below.
Summary charts the label in the charts will be viewed in the language selected.
When viewing the data on Map view, the labels will be displayed in the language selected as shown below.