@itwin/core-i18n 4.11.6 → 4.11.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -1
- package/lib/cjs/test/ITwinLocalization.test.js +28 -13
- package/lib/cjs/test/ITwinLocalization.test.js.map +1 -1
- package/lib/cjs/test/webpack/bundled-tests.instrumented.js +28 -13
- package/lib/cjs/test/webpack/bundled-tests.instrumented.js.map +1 -1
- package/lib/cjs/test/webpack/bundled-tests.js +28 -13
- package/lib/cjs/test/webpack/bundled-tests.js.map +1 -1
- package/lib/esm/test/ITwinLocalization.test.js +28 -13
- package/lib/esm/test/ITwinLocalization.test.js.map +1 -1
- package/package.json +8 -8
|
@@ -26130,9 +26130,14 @@ describe("ITwinLocalization", () => {
|
|
|
26130
26130
|
chai_1.assert.equal(localization.getLocalizedString("SecondTrivial.MissingString"), "SecondTrivial.MissingString");
|
|
26131
26131
|
chai_1.assert.equal(localization.getLocalizedString(["NotExist", "MissingKeyObject.MissingString"]), "MissingKeyObject.MissingString");
|
|
26132
26132
|
});
|
|
26133
|
-
|
|
26134
|
-
|
|
26135
|
-
|
|
26133
|
+
// TODO: Fix test on Linux CI environment
|
|
26134
|
+
// On current Linux CI environment, "@POSIX" is appended as a suffix to the locale,
|
|
26135
|
+
// which means that the en-US locales do not get loaded.
|
|
26136
|
+
if (!navigator.userAgent.toLowerCase().includes("linux")) {
|
|
26137
|
+
it("read from en-US fallback", () => {
|
|
26138
|
+
chai_1.assert.equal(localization.getLocalizedString("OnlyEnglishUS"), "HelloUS");
|
|
26139
|
+
});
|
|
26140
|
+
}
|
|
26136
26141
|
});
|
|
26137
26142
|
describe("Default Namespace (German)", () => {
|
|
26138
26143
|
it("first level with no substitution", () => {
|
|
@@ -26229,9 +26234,14 @@ describe("ITwinLocalization", () => {
|
|
|
26229
26234
|
chai_1.assert.equal(localization.getLocalizedString("Test:SecondTrivial.MissingString"), "SecondTrivial.MissingString");
|
|
26230
26235
|
chai_1.assert.equal(localization.getLocalizedString("Test:MissingKeyObject.MissingString"), "MissingKeyObject.MissingString");
|
|
26231
26236
|
});
|
|
26232
|
-
|
|
26233
|
-
|
|
26234
|
-
|
|
26237
|
+
// TODO: Fix test on Linux CI environment
|
|
26238
|
+
// On current Linux CI environment, "@POSIX" is appended as a suffix to the locale,
|
|
26239
|
+
// which means that the en-US locales do not get loaded.
|
|
26240
|
+
if (!navigator.userAgent.toLowerCase().includes("linux")) {
|
|
26241
|
+
it("read from en-US fallback", () => {
|
|
26242
|
+
chai_1.assert.equal(localization.getLocalizedString("Default:OnlyEnglishUS"), "HelloUS");
|
|
26243
|
+
});
|
|
26244
|
+
}
|
|
26235
26245
|
});
|
|
26236
26246
|
describe("Given Namespace (German)", () => {
|
|
26237
26247
|
it("first level with no substitution", () => {
|
|
@@ -26634,13 +26644,18 @@ describe("ITwinLocalization", () => {
|
|
|
26634
26644
|
// });
|
|
26635
26645
|
describe("#getLanguageList", () => {
|
|
26636
26646
|
let languages;
|
|
26637
|
-
|
|
26638
|
-
|
|
26639
|
-
|
|
26640
|
-
|
|
26641
|
-
|
|
26642
|
-
|
|
26643
|
-
|
|
26647
|
+
// TODO: Fix test on Linux CI environment
|
|
26648
|
+
// On current Linux CI environment, "@POSIX" is appended as a suffix to the locale,
|
|
26649
|
+
// which means that the en-US locales do not get loaded.
|
|
26650
|
+
if (!navigator.userAgent.toLowerCase().includes("linux")) {
|
|
26651
|
+
it("english language list includes en and en-US", async () => {
|
|
26652
|
+
localization = new ITwinLocalization_1.ITwinLocalization();
|
|
26653
|
+
await localization.initialize([]);
|
|
26654
|
+
languages = localization.getLanguageList();
|
|
26655
|
+
chai_1.assert.isTrue(languages.includes("en-US"));
|
|
26656
|
+
chai_1.assert.isTrue(languages.includes("en"));
|
|
26657
|
+
});
|
|
26658
|
+
}
|
|
26644
26659
|
it("when non-english language is set as default, that language and english are included in langauge list", async () => {
|
|
26645
26660
|
germanLocalization = new ITwinLocalization_1.ITwinLocalization({ initOptions: { lng: "de" } });
|
|
26646
26661
|
await germanLocalization.initialize([]);
|