Cart Licenses Contact Support Online Creator Login/Register
Try
Buy
v 1.9.37

Localization & Globalization

This article describes how to localize the Survey Creator UI and give users the ability to localize their surveys.

Localize Survey Creator UI

Survey Creator includes UI translations into several languages. We ship localized strings as dictionary files. The localization engine that works with these files is available as a separate script/module. Reference this script in the <head> tag of your page or import this module in the component that renders Survey Creator:

<script src="https://unpkg.com/survey-creator-core/survey-creator-core.i18n.min.js"></script>
import "survey-creator-core/survey-creator-core.i18n";

The default language for UI elements is English. To change it, set the currentLocale property. For example, the following code translates the Survey Creator UI to French:

SurveyCreator.localization.currentLocale = "fr";

// In modular applications:
import { localization } from "survey-creator-core";
localization.currentLocale = "fr";

You can modify individual translation strings. Call the getLocale(locale) method to get an object with locale translations. Refer to any dictionary file for information about the structure of this object. To modify a translation string, change the corresponding object property:

// Get current locale translations
const translations = SurveyCreator.localization.getLocale("");
// In modular applications
const translations = localization.getLocale("");

// Change text for the `visible` property in Property Grid
translations.p.visible = "Is visible";
// Change text for the `visible` property in Modal Editor
translations.pe.visible = "Is element visible?";
// Change the JSON Editor tab name
translations.ed.jsonEditor = "Edit As Text";

View Localization example

Translation dictionaries are supported by the community and may be incomplete. Feel free to add missing translations to existing dictionaries or create new dictionaries for other languages. You can use English as a base dictionary: copy the file, replace English translations in it, and submit a pull request with the resulting file to the survey-creator repository.

Localize Survey Contents

If you want your users to create multi-language surveys, add the following script to the <head> tag of your page or import the following module in the component that renders Survey Creator:

<script src="https://unpkg.com/survey-core/survey.i18n.min.js"></script>
import "survey-core/survey.i18n";

This script/module allows Survey Creator users to select a default language different from English:

Survey Creator - Default Language dropdown

If you want to restrict the list of available languages, specify the supportedLocales array:

Survey.surveyLocalization.supportedLocales = ["en", "de", "es", "fr"];

// In modular applications
import { surveyLocalization } from 'survey-core';
surveyLocalization.supportedLocales = ["en", "de", "es", "fr"];

Predefined survey texts are translated to the selected language automatically. SurveyJS Library takes translation strings from community-supported dictionaries. Custom texts (questions, choices, page titles, error messages) should be translated by Survey Creator users in the Translation tab. To display it, enable the showTranslationTab property as shown below. Note that users can specify translation strings only for the languages that you list in the supportedLocales array.

const creatorOptions = {
  showTranslationTab: true
};

const creator = new SurveyCreator.SurveyCreator(creatorOptions);

// In modular applications
import { SurveyCreator } from "survey-creator-knockout";
// or
import { SurveyCreator } from "survey-creator-react";
const creator = new SurveyCreator(creatorOptions);

View Multiple Languages example

Dismiss

Tell us what you think

Help us serve you better by taking this brief
survey. We are interested to learn more about
your experience of using our libraries.

We'd really appreciate your feedback.

Approximate time to complete: 2 min.

Start the survey