Create a Multilingual Form
A multilingual form translates its content to multiple languages and allows respondents to fill it out in their native language. Multilingual support enhances accessibility and helps you reach wider audiences by removing language barriers. This example shows how to create multilingual forms in Survey Creator. The form builder already contains a form with translated texts. Open the Translations tab to view and edit them.
Import Dictionary Files
To let survey authors localize their forms, you need to reference or import localization dictionaries.
<script src="https://unpkg.com/survey-core/survey.i18n.min.js"></script>
import "survey-core/survey.i18n";
Since SurveyJS v1.9.112, you may reference or import only the languages you need, as shown below:
<script src="https://unpkg.com/survey-core/i18n/french.js"></script>
<script src="https://unpkg.com/survey-core/i18n/german.js"></script>
<script src="https://unpkg.com/survey-core/i18n/italian.js"></script>
import "survey-core/i18n/french";
import "survey-core/i18n/german";
import "survey-core/i18n/italian";
Activate the Translations Tab
Survey authors use the Translations tab to localize their forms. They can select required languages and add translations for them using a table view. Those translations are saved in the survey JSON schema. To make the Translations tab available, enable the showTranslationTab
property in an object passed to the Survey Creator constructor.
Specify the Default Language
After adding required translations, form authors can select the default form language. To find this setting, activate survey settings in the Property Grid and locate the Select a survey language dropdown under the General category.
A locale code corresponding to the selected language is saved in the survey JSON schema: open the JSON Editor tab and view the locale
property. If a user doesn't change the default language, the form is displayed in English.
Limit Available Languages
You can restrict the list of languages for which survey authors can add translations. To do this, assign an array of white-listed locale codes to the supportedLocales
property of the surveyLocalization
object. Refer to the commented out lines in JavaScript code for a code example.