Skip to content

Commit 92b0ff6

Browse files
tsv2013novikov82
andauthored
Issue/cr 6793 preview tab enable the rtl mode when an rtl language is selected (#9681)
* update rtl surveyjs/survey-creator#6793 * fix test surveyjs/survey-creator#6793 --------- Co-authored-by: Aleksey Novikov <[email protected]>
1 parent 66885bd commit 92b0ff6

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

packages/survey-core/src/surveyStrings.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export var surveyLocalization = {
1818
this.localeNames[loc] = localeConfig.nativeName;
1919
this.localeNamesInEnglish[loc] = localeConfig.englishName;
2020
if (localeConfig.rtl !== undefined) {
21-
this.localeDirections[loc] = localeConfig.rtl;
21+
this.localeDirections[loc] = localeConfig.rtl ? "rtl" : "ltr";
2222
}
2323
},
2424
get currentLocale(): string {

tests/markup/etalon_survey.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { surveyLocalization } from "survey-core";
1+
import { setupLocale } from "survey-core";
22
import { registerMarkupTests } from "./helper";
33

44
registerMarkupTests(
@@ -64,8 +64,7 @@ registerMarkupTests(
6464
},
6565
event: "onAfterRenderSurvey",
6666
initSurvey: (survey) => {
67-
surveyLocalization.locales["tst"] = {};
68-
surveyLocalization.localeDirections["tst"] = "rtl";
67+
setupLocale({ localeCode: "tst", strings: {}, nativeName: "Tst", englishName: "Test", rtl: true });
6968

7069
survey.locale = "tst";
7170
},

0 commit comments

Comments
 (0)