Question T14217
Visible to All Users

On language change some values do not change their names to proper language

created a year ago

Clipboard-File-1.png
Clipboard-File-2.png

Good morning, team!

I have an issue where checkbox, dropdown, radiobox when created, creates three items but
their names are not correct accordingly to the language that is being set. I have attached screenshots. The values of proper language is being set only after first three items are being deleted.

  1. Is it a bug or it is something I can fix from my side?
  2. Can I make by default that it wouldn't generate any items at all?

Answers approved by surveyjs Support

created a year ago (modified a year ago)

Hello,
Thank you for reporting this issue. It appears that new questions use some preconfigured choices and these choices are not translated. We'll check to see whether we can translate choice texts for newly created questions. You can track our progress at https://github.com/surveyjs/survey-creator/issues/4444.

In the meantime, you can manually define choices which appear for newly added items. For this, override the defaultJSON definition for required questions. For instance, the following code defines custom default choices for the Radiogroup and Dropdown questions.

JavaScript
import { settings } from "survey-creator-core"; settings.toolbox.defaultJSON.radiogroup = { choices: ["Artikel 1", "Artikel 2", "Artikel 3"] }; settings.toolbox.defaultJSON.dropdown = { choices: ["Artikel 1", "Artikel 2", "Artikel 3"] };

Clipboard-File-2.png
Alternatively, you can set the choices property to an empty array. Now, new Radiogroup/Dropdown questions don't generate any items.

JavaScript
import { settings } from "survey-creator-core"; settings.toolbox.defaultJSON.radiogroup = { choices: [] }; settings.toolbox.defaultJSON.dropdown = { choices: [] };

Clipboard-File-1.png

Please let me know if you have any further questions.

    Comments (3)

      Hello Erikas,
      I discussed this issue with the team. If you modify the Survey Creator UI locale, you may wish to override these texts using the settings.defaultJSON definition. For instance:

      JavaScript
      import { settings } from "survey-creator-core"; settings.toolbox.defaultJSON = { dropdown: { choices: ["Artikel 1", "Artikel 2", "Artikel 3"] }, tagbox: { choices: ["Artikel 1", "Artikel 2", "Artikel 3"] }, radiogroup: { choices: ["Artikel 1", "Artikel 2", "Artikel 3"] }, checkbox: { choices: ["Artikel 1", "Artikel 2", "Artikel 3"] }, ranking: { choices: ["Artikel 1", "Artikel 2", "Artikel 3"] } };

      View Demo

      EJ EJ
      Erikas Jurgelevicius a year ago

        Jane thank you once again! These solutions were very useful and were exactly what I need :)

          Hi Erikas,
          You're always welcome. Please feel free to contact us if you have any questions or require further assistance.

          P.S. We hope you enjoyed the level of service you received. If so, we would love if you could leave your feedback on SurveyJS page at g2.com. As we’re building our business, every review helps build credibility for future customers and your feedback would be greatly appreciated.