Survey Creator Interface Localization
Localization is the adaptation of a product to the local language of its users. Survey Creator supports UI translation into over 30 languages out of the box. In this demo, the Survey Creator UI is translated into German. Read more...
Localization is the adaptation of a product to the local language of its users. Survey Creator supports UI translation into over 30 languages out of the box. In this demo, the Survey Creator UI is translated into German.
Translated strings are shipped as dictionary files. The localization engine that works with the dictionaries is available as a separate script/module. This script/module imports dictionaries for all languages. Reference this script in the <head>
tag of your page or import this module into 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";
Since Survey Creator v1.9.112, you may reference or import only the languages you need, as shown below:
<script src="https://unpkg.com/survey-creator-core/i18n/french.js"></script>
<script src="https://unpkg.com/survey-creator-core/i18n/german.js"></script>
<script src="https://unpkg.com/survey-creator-core/i18n/italian.js"></script>
import "survey-creator-core/i18n/french";
import "survey-creator-core/i18n/german";
import "survey-creator-core/i18n/italian";
The default language for UI elements is English. To select another language, set the localization.currentLocale
property. This demo shows Survey Creator UI translated into German.
If you want to change individual UI translations, get an object with all translation strings for a specific locale and override the required properties in this object. You can find a full list of available properties in the English dictionary. Refer to the JavaScript tab for a code example.
You can also introduce a custom locale to override multiple UI translations in a batch. Declare an object with your translations and assign it to the locales["localeName"]
property. The following code shows how to do it in a separate TypeScript translation file (dictionary):
// custom-locale.ts
import { editorLocalization } from 'survey-creator-core';
const customLocaleStrings = {
ed: {
addNewQuestion: "New Question",
deletePage: "Remove Page"
}
};
editorLocalization.locales["customlocale"] = customLocaleStrings;
import './localization/custom-locale.ts'
import { localization } from "survey-creator-core";
// ...
// Activate the custom locale
localization.currentLocale = "customlocale";
If any translation strings are missing in your custom locale, they will be taken from the default English locale. You can specify the defaultLocale
property to use another locale as default:
editorLocalization.defaultLocale = "fr";