@itwin/core-i18n 5.3.0-dev.21 → 5.3.0-dev.24
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 +163 -144
- package/lib/cjs/test/webpack/bundled-tests.instrumented.js.map +1 -1
- package/lib/cjs/test/webpack/bundled-tests.js +32 -13
- package/lib/cjs/test/webpack/bundled-tests.js.map +1 -1
- package/lib/cjs/test/webpack/vendors-common_temp_node_modules_pnpm_cross-fetch_4_0_0_node_modules_cross-fetch_dist_browser-24291b.bundled-tests.instrumented.js.map +1 -1
- package/lib/cjs/test/webpack/vendors-common_temp_node_modules_pnpm_cross-fetch_4_0_0_node_modules_cross-fetch_dist_browser-24291b.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
|
@@ -15259,6 +15259,10 @@ var DbResult;
|
|
|
15259
15259
|
DbResult[DbResult["BE_SQLITE_ERROR_SchemaUpgradeRecommended"] = 369098762] = "BE_SQLITE_ERROR_SchemaUpgradeRecommended";
|
|
15260
15260
|
/** schema update require data transform */
|
|
15261
15261
|
DbResult[DbResult["BE_SQLITE_ERROR_DataTransformRequired"] = 385875978] = "BE_SQLITE_ERROR_DataTransformRequired";
|
|
15262
|
+
/** Db not open */
|
|
15263
|
+
DbResult[DbResult["BE_SQLITE_ERROR_NOTOPEN"] = 16777217] = "BE_SQLITE_ERROR_NOTOPEN";
|
|
15264
|
+
/** Error propagating changes during commit */
|
|
15265
|
+
DbResult[DbResult["BE_SQLITE_ERROR_PropagateChangesFailed"] = 33554433] = "BE_SQLITE_ERROR_PropagateChangesFailed";
|
|
15262
15266
|
DbResult[DbResult["BE_SQLITE_LOCKED_SHAREDCACHE"] = 262] = "BE_SQLITE_LOCKED_SHAREDCACHE";
|
|
15263
15267
|
DbResult[DbResult["BE_SQLITE_BUSY_RECOVERY"] = 261] = "BE_SQLITE_BUSY_RECOVERY";
|
|
15264
15268
|
DbResult[DbResult["BE_SQLITE_CANTOPEN_NOTEMPDIR"] = 270] = "BE_SQLITE_CANTOPEN_NOTEMPDIR";
|
|
@@ -23426,9 +23430,14 @@ describe("ITwinLocalization", () => {
|
|
|
23426
23430
|
chai_1.assert.equal(localization.getLocalizedString("SecondTrivial.MissingString"), "SecondTrivial.MissingString");
|
|
23427
23431
|
chai_1.assert.equal(localization.getLocalizedString(["NotExist", "MissingKeyObject.MissingString"]), "MissingKeyObject.MissingString");
|
|
23428
23432
|
});
|
|
23429
|
-
|
|
23430
|
-
|
|
23431
|
-
|
|
23433
|
+
// TODO: Fix test on Linux CI environment
|
|
23434
|
+
// On current Linux CI environment, "@POSIX" is appended as a suffix to the locale,
|
|
23435
|
+
// which means that the en-US locales do not get loaded.
|
|
23436
|
+
if (!navigator.userAgent.toLowerCase().includes("linux")) {
|
|
23437
|
+
it("read from en-US fallback", () => {
|
|
23438
|
+
chai_1.assert.equal(localization.getLocalizedString("OnlyEnglishUS"), "HelloUS");
|
|
23439
|
+
});
|
|
23440
|
+
}
|
|
23432
23441
|
});
|
|
23433
23442
|
describe("Default Namespace (German)", () => {
|
|
23434
23443
|
it("first level with no substitution", () => {
|
|
@@ -23525,9 +23534,14 @@ describe("ITwinLocalization", () => {
|
|
|
23525
23534
|
chai_1.assert.equal(localization.getLocalizedString("Test:SecondTrivial.MissingString"), "SecondTrivial.MissingString");
|
|
23526
23535
|
chai_1.assert.equal(localization.getLocalizedString("Test:MissingKeyObject.MissingString"), "MissingKeyObject.MissingString");
|
|
23527
23536
|
});
|
|
23528
|
-
|
|
23529
|
-
|
|
23530
|
-
|
|
23537
|
+
// TODO: Fix test on Linux CI environment
|
|
23538
|
+
// On current Linux CI environment, "@POSIX" is appended as a suffix to the locale,
|
|
23539
|
+
// which means that the en-US locales do not get loaded.
|
|
23540
|
+
if (!navigator.userAgent.toLowerCase().includes("linux")) {
|
|
23541
|
+
it("read from en-US fallback", () => {
|
|
23542
|
+
chai_1.assert.equal(localization.getLocalizedString("Default:OnlyEnglishUS"), "HelloUS");
|
|
23543
|
+
});
|
|
23544
|
+
}
|
|
23531
23545
|
});
|
|
23532
23546
|
describe("Given Namespace (German)", () => {
|
|
23533
23547
|
it("first level with no substitution", () => {
|
|
@@ -23930,13 +23944,18 @@ describe("ITwinLocalization", () => {
|
|
|
23930
23944
|
// });
|
|
23931
23945
|
describe("#getLanguageList", () => {
|
|
23932
23946
|
let languages;
|
|
23933
|
-
|
|
23934
|
-
|
|
23935
|
-
|
|
23936
|
-
|
|
23937
|
-
|
|
23938
|
-
|
|
23939
|
-
|
|
23947
|
+
// TODO: Fix test on Linux CI environment
|
|
23948
|
+
// On current Linux CI environment, "@POSIX" is appended as a suffix to the locale,
|
|
23949
|
+
// which means that the en-US locales do not get loaded.
|
|
23950
|
+
if (!navigator.userAgent.toLowerCase().includes("linux")) {
|
|
23951
|
+
it("english language list includes en and en-US", async () => {
|
|
23952
|
+
localization = new ITwinLocalization_1.ITwinLocalization();
|
|
23953
|
+
await localization.initialize([]);
|
|
23954
|
+
languages = localization.getLanguageList();
|
|
23955
|
+
chai_1.assert.isTrue(languages.includes("en-US"));
|
|
23956
|
+
chai_1.assert.isTrue(languages.includes("en"));
|
|
23957
|
+
});
|
|
23958
|
+
}
|
|
23940
23959
|
it("when non-english language is set as default, that language and english are included in langauge list", async () => {
|
|
23941
23960
|
germanLocalization = new ITwinLocalization_1.ITwinLocalization({ initOptions: { lng: "de" } });
|
|
23942
23961
|
await germanLocalization.initialize([]);
|