Hi,
I want to change the language of the designer survey so that dropdown questions show the localized string instead of "Choose…". So I did it this way right now: https://plnkr.co/edit/ZGYzNUSdO0Wiwb3mNVie?p=preview
But if you add a dropdown question in this example, there is still the "Choose…" string on this question. The localized string appears for example after switching to the JSON Editor tab and then switch back to the designer.
Also, if I add some answer text now, it shows up like this in the survey JSON:
JavaScript"choices": [
{
"value": "item1",
"text": {
"de": "asd"
}
},
"item2",
"item3"
]
But I don't want to add german answer text here. I just want the designer survey to show up in german. And if I edit any element text in the survey, I still want it to be for the default language until we implemented our own localization tool and just switch the strings in our backend.
Any suggestions how to achieve that?
Thanks!
Hello,
I've slightly modified your plunk - https://plnkr.co/edit/4TSGwSWse7TwFOk2dLlB?p=preview
Does it fit your needs?
Thanks, Serge
SurveyJS Team
Hi,
not really. Text is still stored as german translation like shown above.
I would expect
"choices": [ { "value": "item1", "text": "asd" }, "item2", "item3" ]
instead. Can I change that anyway?
Thanks!
Hello Hendrik,
I'm afraid I don't understand you. Could you please specify in greater details what are you expecting?
Thanks, Serge
SurveyJS Team
Hi,
I just want to show the designer survey in german, so that for example a dropdown question shows "Wählen…" instead of "Choose…".
But at the same time, I do NOT want any text of answers or questions to be stored as german translation. Because we use our own tool for survey translations. So I want the editor to store the survey JSON as if the default language is selected.
Instead of:
"choices": [ { "value": "item1", "text": { "de": "asd" // German translation for answer } }, "item2", "item3" ]
I want the JSON to be stored like this:
"choices": [ { "value": "item1", "text": "asd" // Default answer text }, "item2", "item3" ]
Thanks!
Hello Hendrik,
Yes, you are right. We will do something with it.
For now, as a workaround you may use the following code before saving the survey JSON:
Thank you,
Andrew
SurveyJS Team
Sounds great! Any idea when the final solution will be available?
Thanks!
We have to refactor and make some changes in our localization mechanism. The main idea is to separate the default local survey locale property and global locale. Anyway, we definitely want to fix the problem you have describe.'
We will work on this next week. I will keep this issue open and we will comeback as soon we have something.
Thank you,
Andrew
SurveyJS Team
Great, I will look forward to that! Thank you!
Hello Hendrik,
I have decided to work on refactoring this code and found that your task can be solved with one line of code. In fact we already have unit test on this scenario.
Survey.surveyLocalization.defaultLocale = "de";
I am sorry for being sloppy on this issue.
Thank you,
Andrew
SurveyJS Team
Great, that helps! Thanks a lot :)