@prosopo/locale 3.11.1 → 3.12.1
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/.turbo/turbo-build$colon$cjs.log +6 -6
- package/.turbo/turbo-build$colon$tsc.log +5 -5
- package/.turbo/turbo-build.log +7 -7
- package/CHANGELOG.md +70 -0
- package/README.md +11 -9
- package/dist/cjs/errorMessage.cjs +11 -10
- package/dist/cjs/index.cjs +2 -1
- package/dist/cjs/locales/en/widget.cjs +44 -1
- package/dist/cjs/translationKey.cjs +3 -3
- package/dist/errorMessage.d.ts +6 -4
- package/dist/errorMessage.d.ts.map +1 -1
- package/dist/errorMessage.js +10 -10
- package/dist/errorMessage.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/locales/af/widget.json +41 -0
- package/dist/locales/am/widget.json +41 -0
- package/dist/locales/an/widget.json +41 -0
- package/dist/locales/ar/widget.json +41 -0
- package/dist/locales/as/widget.json +41 -0
- package/dist/locales/ast/widget.json +41 -0
- package/dist/locales/az/widget.json +41 -0
- package/dist/locales/be/widget.json +41 -0
- package/dist/locales/bg/widget.json +41 -0
- package/dist/locales/bn/widget.json +41 -0
- package/dist/locales/bs/widget.json +41 -0
- package/dist/locales/ca/widget.json +41 -0
- package/dist/locales/cs/widget.json +41 -0
- package/dist/locales/cy/widget.json +41 -0
- package/dist/locales/da/widget.json +41 -0
- package/dist/locales/de/widget.json +41 -0
- package/dist/locales/el/widget.json +41 -0
- package/dist/locales/en/widget.js +44 -2
- package/dist/locales/en/widget.json +41 -0
- package/dist/locales/eo/widget.json +41 -0
- package/dist/locales/es/widget.json +41 -0
- package/dist/locales/et/widget.json +41 -0
- package/dist/locales/eu/widget.json +41 -0
- package/dist/locales/fa/widget.json +41 -0
- package/dist/locales/fi/widget.json +41 -0
- package/dist/locales/fil/widget.json +41 -0
- package/dist/locales/fr/widget.json +41 -0
- package/dist/locales/fy/widget.json +41 -0
- package/dist/locales/ga/widget.json +41 -0
- package/dist/locales/gd/widget.json +41 -0
- package/dist/locales/gl/widget.json +41 -0
- package/dist/locales/gu/widget.json +41 -0
- package/dist/locales/he/widget.json +41 -0
- package/dist/locales/hi/widget.json +41 -0
- package/dist/locales/hr/widget.json +41 -0
- package/dist/locales/hu/widget.json +41 -0
- package/dist/locales/hy/widget.json +41 -0
- package/dist/locales/ia/widget.json +41 -0
- package/dist/locales/id/widget.json +41 -0
- package/dist/locales/is/widget.json +41 -0
- package/dist/locales/it/widget.json +41 -0
- package/dist/locales/ja/widget.json +41 -0
- package/dist/locales/jv/widget.json +41 -0
- package/dist/locales/ka/widget.json +41 -0
- package/dist/locales/kk/widget.json +41 -0
- package/dist/locales/km/widget.json +41 -0
- package/dist/locales/kn/widget.json +41 -0
- package/dist/locales/ko/widget.json +41 -0
- package/dist/locales/ky/widget.json +41 -0
- package/dist/locales/lo/widget.json +41 -0
- package/dist/locales/lt/widget.json +41 -0
- package/dist/locales/lv/widget.json +41 -0
- package/dist/locales/mk/widget.json +41 -0
- package/dist/locales/ml/widget.json +41 -0
- package/dist/locales/mn/widget.json +41 -0
- package/dist/locales/mr/widget.json +41 -0
- package/dist/locales/ms/widget.json +41 -0
- package/dist/locales/my/widget.json +41 -0
- package/dist/locales/ne/widget.json +41 -0
- package/dist/locales/nl/widget.json +41 -0
- package/dist/locales/nn/widget.json +41 -0
- package/dist/locales/no/widget.json +41 -0
- package/dist/locales/oc/widget.json +41 -0
- package/dist/locales/or/widget.json +41 -0
- package/dist/locales/pa/widget.json +41 -0
- package/dist/locales/pl/widget.json +41 -0
- package/dist/locales/pt/widget.json +41 -0
- package/dist/locales/pt-BR/widget.json +41 -0
- package/dist/locales/rm/widget.json +41 -0
- package/dist/locales/ro/widget.json +41 -0
- package/dist/locales/ru/widget.json +41 -0
- package/dist/locales/sco/widget.json +41 -0
- package/dist/locales/si/widget.json +41 -0
- package/dist/locales/sk/widget.json +41 -0
- package/dist/locales/sl/widget.json +41 -0
- package/dist/locales/sq/widget.json +41 -0
- package/dist/locales/sr/widget.json +41 -0
- package/dist/locales/sv/widget.json +41 -0
- package/dist/locales/sw/widget.json +41 -0
- package/dist/locales/ta/widget.json +41 -0
- package/dist/locales/te/widget.json +41 -0
- package/dist/locales/tg/widget.json +41 -0
- package/dist/locales/th/widget.json +41 -0
- package/dist/locales/tr/widget.json +41 -0
- package/dist/locales/uk/widget.json +41 -0
- package/dist/locales/ur/widget.json +41 -0
- package/dist/locales/uz/widget.json +41 -0
- package/dist/locales/vi/widget.json +41 -0
- package/dist/locales/xh/widget.json +41 -0
- package/dist/locales/zh/widget.json +41 -0
- package/dist/locales/zh-CN/widget.json +41 -0
- package/dist/locales/zh-HK/widget.json +41 -0
- package/dist/locales/zh-TW/widget.json +41 -0
- package/dist/locales/zu/widget.json +41 -0
- package/dist/tests/errorMessage.unit.test.js +41 -31
- package/dist/tests/errorMessage.unit.test.js.map +1 -1
- package/dist/tests/resultReasonKeys.unit.test.d.ts +2 -0
- package/dist/tests/resultReasonKeys.unit.test.d.ts.map +1 -0
- package/dist/tests/resultReasonKeys.unit.test.js +26 -0
- package/dist/tests/resultReasonKeys.unit.test.js.map +1 -0
- package/dist/tests/translationKey.unit.test.js +1 -0
- package/dist/tests/translationKey.unit.test.js.map +1 -1
- package/dist/translationKey.js +3 -3
- package/package.json +8 -8
- package/dist/tests/thrownErrorKeys.unit.test.d.ts +0 -2
- package/dist/tests/thrownErrorKeys.unit.test.d.ts.map +0 -1
- package/dist/tests/thrownErrorKeys.unit.test.js +0 -51
- package/dist/tests/thrownErrorKeys.unit.test.js.map +0 -1
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import fs from "node:fs";
|
|
2
|
-
import path from "node:path";
|
|
3
|
-
import { describe, expect, test } from "vitest";
|
|
4
|
-
import { isTranslationKey } from "../serverTranslationKeys.js";
|
|
5
|
-
const PACKAGES_DIR = path.resolve("..");
|
|
6
|
-
const THROWN_KEY = /Error\(\s*["']([A-Z][A-Z_]*\.[A-Z0-9_]+)["']/g;
|
|
7
|
-
const REASON_KEY = /=\s*"([A-Z][A-Z_]*\.[A-Z0-9_]+)"/g;
|
|
8
|
-
const isCatalogueKey = (key) => isTranslationKey(key);
|
|
9
|
-
const sourceFiles = (dir) => fs.readdirSync(dir, { withFileTypes: true }).flatMap((entry) => {
|
|
10
|
-
const full = path.join(dir, entry.name);
|
|
11
|
-
if (entry.isDirectory()) {
|
|
12
|
-
return entry.name === "tests" || entry.name === "node_modules"
|
|
13
|
-
? []
|
|
14
|
-
: sourceFiles(full);
|
|
15
|
-
}
|
|
16
|
-
return entry.name.endsWith(".ts") && !entry.name.includes(".test.")
|
|
17
|
-
? [full]
|
|
18
|
-
: [];
|
|
19
|
-
});
|
|
20
|
-
const workspaceSources = () => fs
|
|
21
|
-
.readdirSync(PACKAGES_DIR)
|
|
22
|
-
.map((name) => path.join(PACKAGES_DIR, name, "src"))
|
|
23
|
-
.filter((dir) => fs.existsSync(dir))
|
|
24
|
-
.flatMap(sourceFiles);
|
|
25
|
-
const uncataloguedKeys = (files, pattern) => {
|
|
26
|
-
const missing = new Set();
|
|
27
|
-
for (const file of files) {
|
|
28
|
-
for (const match of fs.readFileSync(file, "utf8").matchAll(pattern)) {
|
|
29
|
-
const key = match[1];
|
|
30
|
-
if (key && !isCatalogueKey(key)) {
|
|
31
|
-
missing.add(`${key} (${path.relative(PACKAGES_DIR, file)})`);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
return [...missing].sort();
|
|
36
|
-
};
|
|
37
|
-
describe("error keys", () => {
|
|
38
|
-
test("every key an error class is constructed with is in the catalogue", () => {
|
|
39
|
-
expect(uncataloguedKeys(workspaceSources(), THROWN_KEY)).toEqual([]);
|
|
40
|
-
});
|
|
41
|
-
test("every ResultReason is in the catalogue", () => {
|
|
42
|
-
const reasons = path.join(PACKAGES_DIR, "types/src/provider/reasons.ts");
|
|
43
|
-
expect(uncataloguedKeys([reasons], REASON_KEY)).toEqual([]);
|
|
44
|
-
});
|
|
45
|
-
test("the scan finds the keys it is looking for", () => {
|
|
46
|
-
const found = workspaceSources().flatMap((file) => [...fs.readFileSync(file, "utf8").matchAll(THROWN_KEY)].map((match) => match[1]));
|
|
47
|
-
expect(found).toContain("DATABASE.DATABASE_IMPORT_FAILED");
|
|
48
|
-
expect(found.length).toBeGreaterThan(100);
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
|
-
//# sourceMappingURL=thrownErrorKeys.unit.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"thrownErrorKeys.unit.test.js","sourceRoot":"","sources":["../../src/tests/thrownErrorKeys.unit.test.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAO/D,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AACxC,MAAM,UAAU,GAAG,+CAA+C,CAAC;AACnE,MAAM,UAAU,GAAG,mCAAmC,CAAC;AAGvD,MAAM,cAAc,GAAG,CAAC,GAAW,EAAW,EAAE,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;AAEvE,MAAM,WAAW,GAAG,CAAC,GAAW,EAAY,EAAE,CAC7C,EAAE,CAAC,WAAW,CAAC,GAAG,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,KAAgB,EAAE,EAAE;IACzE,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IACxC,IAAI,KAAK,CAAC,WAAW,EAAE,EAAE,CAAC;QACzB,O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