surveyjs / survey-library

Free JavaScript form builder library with integration for React, Angular, Vue, jQuery, and Knockout.
https://surveyjs.io/form-library
MIT License
4.21k stars 814 forks source link

`default` attribute doesn't apply for a custom localizable property #7630

Closed andrewtelnov closed 10 months ago

andrewtelnov commented 10 months ago

The following code code adds a new localizable string property:

Survey.Serializer.addProperty("question", 
  { name: "customProp", isLocalizable: true, default: "default Str", category: "general" }
);

However, it doesn't work correctly in the property grid.

andrewtelnov commented 10 months ago

We don't need this functionality, since default value for localization string should be define in localization strings:

Survey.surveyLocalization.getLocaleStrings("en")["customProp"] = "default for en";
Survey.surveyLocalization.getLocaleStrings("fr")["customProp"] = "default for fr";

We need to update the documentation accordingly

RomanTsukanov commented 10 months ago

Fixed in https://github.com/surveyjs/survey-creator/pull/5057