surveyjs / survey-creator

Scalable open-source survey software to generate dynamic JSON-driven forms within your JavaScript application. The form builder features a drag-and-drop UI, CSS Theme Editor, and GUI for conditional logic and form branching.
https://surveyjs.io/open-source
Other
898 stars 373 forks source link

Property Grid - The 'Type To Search...' label of a drop-down action cannot be translated #5139

Closed JaneSjs closed 8 months ago

JaneSjs commented 8 months ago

User Issue: T16627 - Override Individual Translations in Survey Creator https://surveyjs.answerdesk.io/internal/ticket/details/T16627


View Demo

It is unclear how to change / translate the 'Type To Search...' label. It appears within the search box of a property grid or within the Translation tab's property grid: image

andrewtelnov commented 8 months ago

"Type to search..." string is located in the survey. It shows in all list popups with the search editor. You can change is as the following:

const enStrings = Survey.surveyLocalization.getLocaleStrings("en");
enStrings.filterStringPlaceholder = "Type...";

However, it will be changed everywhere. If you want to change this string for translation tab only then you can use the code from this example.

const enStrings = Survey.surveyLocalization.getLocaleStrings("en");
const typeToSearchStr = enStrings.filterStringPlaceholder;
    creator.onActiveTabChanging.add((sender, options) => {
        if(options.tabName === "translation") {
            enStrings.filterStringPlaceholder = "Type..";
        } else {
            if(creator.activeTab === "translation") {
                enStrings.filterStringPlaceholder = typeToSearchStr;
            }
        }
    });

Thank you, Andrew