Skip to content

Commit

Permalink
Add localization for autogenerate prop, surveyjs/survey-library#6169 (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewtelnov committed May 11, 2023
1 parent a21fb2d commit 1c343b5
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/survey-creator-core/src/localization/english.ts
Expand Up @@ -770,7 +770,11 @@ export var enStrings = {
buttons: "Buttons",
dropdown: "Dropdown"
},
rateColorMode: { default: "Default" }
rateColorMode: { default: "Default" },
autoGenerate: {
"true": "Generate",
"false": "Enter manually"
}
},
// Operators
op: {
Expand Down
4 changes: 4 additions & 0 deletions packages/survey-creator-core/src/localization/german.ts
Expand Up @@ -743,6 +743,10 @@ var germanTranslation = {
// auto: "Auto",
// buttons: "Buttons",
// dropdown: "Dropdown"
},
autoGenerate: {
"true": "Generieren",
"false": "Manuell Eintragen"
}
},
// Operators
Expand Down
17 changes: 17 additions & 0 deletions packages/survey-creator-core/tests/localization.tests.ts
Expand Up @@ -189,3 +189,20 @@ test("Check creator license localization", (): any => {
const creator = new CreatorTester({});
expect(creator.licenseText).toBe("PLEASE PURCHASE A DEVELOPER LICENSE TO BE ABLE TO USE SURVEY CREATOR IN YOUR APP");
});
test("getPropertyValue autoGenerate and boolean", () => {
expect(editorLocalization.getPropertyValueInEditor("autoGenerate", true)).toEqual("Generate");
expect(editorLocalization.getPropertyValueInEditor("autoGenerate", false)).toEqual("Enter manually");
const deutschStrings: any = {
pv: {
autoGenerate: {
"true": "Generieren",
"false": "Manuell Eintragen"
}
}
};
editorLocalization.locales["de"] = deutschStrings;
editorLocalization.currentLocale = "de";
expect(editorLocalization.getPropertyValueInEditor("autoGenerate", true)).toEqual("Generieren");
expect(editorLocalization.getPropertyValueInEditor("autoGenerate", false)).toEqual("Manuell Eintragen");
editorLocalization.currentLocale = "";
});

0 comments on commit 1c343b5

Please sign in to comment.