@itwin/core-i18n 5.2.3 → 5.2.5
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 +11 -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 +6 -6
|
@@ -25685,9 +25685,14 @@ describe("ITwinLocalization", () => {
|
|
|
25685
25685
|
chai_1.assert.equal(localization.getLocalizedString("SecondTrivial.MissingString"), "SecondTrivial.MissingString");
|
|
25686
25686
|
chai_1.assert.equal(localization.getLocalizedString(["NotExist", "MissingKeyObject.MissingString"]), "MissingKeyObject.MissingString");
|
|
25687
25687
|
});
|
|
25688
|
-
|
|
25689
|
-
|
|
25690
|
-
|
|
25688
|
+
// TODO: Fix test on Linux CI environment
|
|
25689
|
+
// On current Linux CI environment, "@POSIX" is appended as a suffix to the locale,
|
|
25690
|
+
// which means that the en-US locales do not get loaded.
|
|
25691
|
+
if (!navigator.userAgent.toLowerCase().includes("linux")) {
|
|
25692
|
+
it("read from en-US fallback", () => {
|
|
25693
|
+
chai_1.assert.equal(localization.getLocalizedString("OnlyEnglishUS"), "HelloUS");
|
|
25694
|
+
});
|
|
25695
|
+
}
|
|
25691
25696
|
});
|
|
25692
25697
|
describe("Default Namespace (German)", () => {
|
|
25693
25698
|
it("first level with no substitution", () => {
|
|
@@ -25784,9 +25789,14 @@ describe("ITwinLocalization", () => {
|
|
|
25784
25789
|
chai_1.assert.equal(localization.getLocalizedString("Test:SecondTrivial.MissingString"), "SecondTrivial.MissingString");
|
|
25785
25790
|
chai_1.assert.equal(localization.getLocalizedString("Test:MissingKeyObject.MissingString"), "MissingKeyObject.MissingString");
|
|
25786
25791
|
});
|
|
25787
|
-
|
|
25788
|
-
|
|
25789
|
-
|
|
25792
|
+
// TODO: Fix test on Linux CI environment
|
|
25793
|
+
// On current Linux CI environment, "@POSIX" is appended as a suffix to the locale,
|
|
25794
|
+
// which means that the en-US locales do not get loaded.
|
|
25795
|
+
if (!navigator.userAgent.toLowerCase().includes("linux")) {
|
|
25796
|
+
it("read from en-US fallback", () => {
|
|
25797
|
+
chai_1.assert.equal(localization.getLocalizedString("Default:OnlyEnglishUS"), "HelloUS");
|
|
25798
|
+
});
|
|
25799
|
+
}
|
|
25790
25800
|
});
|
|
25791
25801
|
describe("Given Namespace (German)", () => {
|
|
25792
25802
|
it("first level with no substitution", () => {
|
|
@@ -26189,13 +26199,18 @@ describe("ITwinLocalization", () => {
|
|
|
26189
26199
|
// });
|
|
26190
26200
|
describe("#getLanguageList", () => {
|
|
26191
26201
|
let languages;
|
|
26192
|
-
|
|
26193
|
-
|
|
26194
|
-
|
|
26195
|
-
|
|
26196
|
-
|
|
26197
|
-
|
|
26198
|
-
|
|
26202
|
+
// TODO: Fix test on Linux CI environment
|
|
26203
|
+
// On current Linux CI environment, "@POSIX" is appended as a suffix to the locale,
|
|
26204
|
+
// which means that the en-US locales do not get loaded.
|
|
26205
|
+
if (!navigator.userAgent.toLowerCase().includes("linux")) {
|
|
26206
|
+
it("english language list includes en and en-US", async () => {
|
|
26207
|
+
localization = new ITwinLocalization_1.ITwinLocalization();
|
|
26208
|
+
await localization.initialize([]);
|
|
26209
|
+
languages = localization.getLanguageList();
|
|
26210
|
+
chai_1.assert.isTrue(languages.includes("en-US"));
|
|
26211
|
+
chai_1.assert.isTrue(languages.includes("en"));
|
|
26212
|
+
});
|
|
26213
|
+
}
|
|
26199
26214
|
it("when non-english language is set as default, that language and english are included in langauge list", async () => {
|
|
26200
26215
|
germanLocalization = new ITwinLocalization_1.ITwinLocalization({ initOptions: { lng: "de" } });
|
|
26201
26216
|
await germanLocalization.initialize([]);
|