Hello,
When working with a translated survey, I can't delete the title of a question in all languages using the creator.
Here are the steps to reproduce this behavior:
- Start off with the following survey, it has a single question with a translated title and its' locale is set to a non-default value. The goal is to fully delete the title of the question.
JSON{
"locale": "de",
"pages": [
{
"name": "page1",
"elements": [
{
"type": "text",
"name": "question1",
"title": {
"de": "Versuch",
"default": "Experiment"
}
}
]
}
]
}
- Select the question in the creator and delete the title "Versuch".
- Unselect the question.
- The question now displays the default language title "Experiment".
Deleting this title is not synchronised to the json definition of the survey - this applies to both the middle editor as well as the property grid. It is only possible after removing the survey language (root locale
property), but I don't feel like I can expect users to first go to the main settings of the survey and use the eraser button on the locale dropdown…
Looking forward to your thoughts on this.
Thanks,
Lucas
Hi Lucas,
In a default locale, when a question title is empty, the title displays a question name:
In a custom locale, the
en
title appears as a default title; therefore, if you remove this title, a question will display a title defined for the default locale (en
).Would you please clarify the desired behavior? Do you wish to display a custom title text in a default locale and reset the title and display the question's
name
in ade
locale?I look forward to your reply.
Hello Jane,
Thank you for the detailed response. I understand the behavior of fallbacks and have no issue with it (first the title in the correct locale, then in the default locale and then the question name).
My only issue is that once a title is set in a localized survey, there is no way to fully delete it without using the JSON Editor. You can use the exact JSON shown in your second screenshot: As far as I can tell there is no way remove
"Eng Title"
using the Creator UI, such that "question1" is shown as the title of the question.Please let me know whether or not you can reproduce this behavior.
Thanks,
Lucas
Hello Lucas,
You can hide the title completely by setting titleLocation property ("Layout" category) to "hidden".
I am working on this ticket during this sprint. You will be able to set an empty space into title property editor. You can't do it right now. You can set it in JSON editor only.
Thank you,
Andrew
SurveyJS Team
Hello Andrew,
Thank you for your response.
I know about hiding titles and also figured out the single-space value for question which have a description, but no title.
However, this ticket is only regarding fully deleting the title, such that the question name is shown again.
I think there should be a way for users to fully remove the
title
property without having to access the json.(I'm mainly asking for this in order for users to be able to fully "clean up" the json, rather than actually having a use case where I need to display the question name as the title.)
Thanks,
Lucas
Hi Lucas,
Thank you for the additional clarification. I understand your point. Unfortunately, in a localized survey, there is no option to reset a question title to its initial state and force the title to copy a question name.
A localized survey always uses a default locale (English, in this case) as a fallback locale. This means that if strings are undefined in a custom locale (e.g.,
fr
), default locale strings (e.g., English) will be used.If English is not your default language, you can change the default language using the following setting:
import { surveyLocalization } from "survey-core" surveyLocalization.defaultLocale = 'it';
View Demo
Now, users can specify strings for English and other custom locales.
By the way, I'm curious about the actual usage scenario behind this requirement. Do I correctly understand that users may want to use question names as question titles? To my understanding, a question title should be a meaningful word/phrase rather than a question name which is more like a unique identifier value.
I look forward to your reply.
Hello Jane,
One of the use cases is moving a title from the question itself to another element such as a panel. For this, the user copies the title to that other element, than comes back to the question to set the title hidden. What is left is the original copy of the title which can be deleted in the UI, but than that change is never saved. This is perceived as a bug and has the additional problem that there are now two copies of the same title in the survey, both in the JSON as well as the property grid.
But thank you for taking the time to investigate and confirm that this is indeed not possible, I'll pass it on.
Thanks,
Lucas
Hi Lucas,
Thank you for the update. The main idea here is that in a localized survey, strings defined within a default locale become fallback strings to which all strings are reset when they are not defined in a custom locale.
I appreciate your understanding. Please feel free to reach out if you have any further questions.