Skip to content

Commit

Permalink
Changing the creator.locale doesn't translate toolbox items which app…
Browse files Browse the repository at this point in the history
…ear in a More... popup form fix #5044 (#5047)
  • Loading branch information
andrewtelnov authored Jan 4, 2024
1 parent 3261b26 commit e9a1dad
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
14 changes: 9 additions & 5 deletions packages/survey-creator-core/src/toolbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -466,13 +466,17 @@ export class QuestionToolbox
}
public updateTitles(): void {
this.actions.forEach(action => {
const newTitle = editorLocalization.getString("qt." + action.name);
if (!!newTitle) {
action.title = newTitle;
action.tooltip = newTitle;
}
this.updateActionTitle(action);
this.updateActionTitle(action.innerItem);
});
}
private updateActionTitle(action: IAction): void {
const newTitle = editorLocalization.getString("qt." + action.id);
if (!!newTitle) {
action.title = newTitle;
action.tooltip = newTitle;
}
}
private updateCategoriesState() {
var noActive = this.allowExpandMultipleCategories || this.keepAllCategoriesExpanded;
if (noActive) {
Expand Down
2 changes: 2 additions & 0 deletions packages/survey-creator-core/tests/localization.tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ test("Change Creator locale property", (): any => {
expect(creator.propertyGrid.getQuestionByName("title").title).toEqual("Titel");
expect(tabButton.title).toEqual("Logik");
expect(textQuestion.title).toEqual("Text");
expect(textQuestion.innerItem.title).toEqual("Text");
expect(saveAction.locTitle.text).toEqual("Umfrage speichern");
creator.selectElement(creator.survey.getQuestionByName("q2"));
expect(creator.propertyGrid.getQuestionByName("format").title).toEqual("Format de");
Expand All @@ -191,6 +192,7 @@ test("Change Creator locale property", (): any => {
expect(creator.propertyGrid.getQuestionByName("title").title).toEqual("Title");
expect(tabButton.title).toEqual("Logic");
expect(textQuestion.title).toEqual("Single-Line Input");
expect(textQuestion.innerItem.title).toEqual("Single-Line Input");
expect(saveAction.title).toEqual("Save Survey");
});
test("Check creator license localization", (): any => {
Expand Down

0 comments on commit e9a1dad

Please sign in to comment.