Question T10753
Visible to All Users

Rename all occurrences of "survey" to "quiz" and rename survey title and description placeholders

created 2 years ago

Hi Team,

  1. I want to rename all occurrences of "survey" to "quiz". Is there any property that I can use?
    Clipboard-File-1.png

  2. I have been able to set custom survey title and description placeholders in the property grid by using below code:

Code
const placeHolderTexts = {             survey: {                 title: "Please type quiz title",                 description: "Please type quiz description"             },             page: {                 title: "Please type page title",                 description: "Please type page description"             },             question: {                 title: "Please type question title",                 description: "Please type question description"             },         } creator.onPropertyEditorCreated.add((_, options) => { const type = options.obj.isQuestion ? "question" : options.obj.getType(); const placeHolderObj = placeHolderTexts[type]; if (!placeHolderObj || !placeHolderObj[options.property.name]) return; options.editor.placeHolder = placeHolderObj[options.property.name]; });

Is there any similar way to set custom placeholder in the survey title on designer?
Clipboard-File-2.png

Thanks,
Shalaka

Answers

created 2 years ago (modified 2 years ago)

Hello,
You can customize texts used in the designer by updating the Survey Creator localization.

If you use the default English language, explore a list of strings used by the creator at english.ts. To customize the translation, obtain the translation object using the getLocale method and customize individual properties.

For example:

JavaScript
const engLocale = SurveyCreator.localization.getLocale("en"); engLocale.ed.survey = "Quiz"; engLocale.ed.settings = "Quiz Settings"; engLocale.ed.surveyTypeName = "Quiz"; engLocale.pe.surveyTitlePlaceholder = "Quiz Title"; engLocale.ed.surveyPlaceHolder = "The quiz is empty. Drag an element from the toolbox or click the button below.";

Example.
Clipboard-File-1.png

You can also create a custom locale to apply multiple translations in a batch. For more information, refer to Override Individual Translations.
See also: Survey Creator Interface Localization.

I hope this helps. Please let me know if you have any questions.

Thank you

    Comments (2)

      That helped! With the localization properties I am able to rename the necessary labels.
      Thank you Jane. Will explore the links that you have shared.

      Thanks,
      Shalaka

        You're very welcome, Shalaka. Please feel free to contact us if you have any questions or require further assistance.
        We are here to help.

        Thanks,
        Jane
        SurveyJS Team