If survey title
and description
are already set (in Translation Tab), I can access their values and add new languages like this:
JavaScriptthis.surveyCreator.JSON.description.en = "My title;
this.surveyCreator.JSON.description.lv = "Nosaukums;
However, if they are not set in UI, I cannot set them in code. The following sample does not work as I would expect.
JavaScriptthis.surveyCreator.JSON.description = {
en: "My title",
default: "My title"
};
console.log(this.surveyCreator.JSON.description); // this appears to be undefined
this.surveyCreator.JSON.description.lv = "Desc LV"; // this throws "TypeError: Cannot set property 'lv' of undefined"
How can I set title
and description
programmatically?