@rexezuge/i18n 0.0.0-stage → 1.0.0

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.
Files changed (63) hide show
  1. package/LICENSE +21 -0
  2. package/dist/BackendStrings.d.ts +87 -0
  3. package/dist/BackendStrings.d.ts.map +1 -0
  4. package/dist/BackendStrings.js +90 -0
  5. package/dist/BackendStrings.js.map +1 -0
  6. package/dist/getLocalizedStrings.d.ts +32 -0
  7. package/dist/getLocalizedStrings.d.ts.map +1 -0
  8. package/dist/getLocalizedStrings.js +62 -0
  9. package/dist/getLocalizedStrings.js.map +1 -0
  10. package/dist/index.d.ts +24 -0
  11. package/dist/index.d.ts.map +1 -0
  12. package/dist/index.js +26 -0
  13. package/dist/index.js.map +1 -0
  14. package/dist/locales/de.d.ts +4 -0
  15. package/dist/locales/de.d.ts.map +1 -0
  16. package/dist/locales/de.js +9 -0
  17. package/dist/locales/de.js.map +1 -0
  18. package/dist/locales/en.d.ts +4 -0
  19. package/dist/locales/en.d.ts.map +1 -0
  20. package/dist/locales/en.js +9 -0
  21. package/dist/locales/en.js.map +1 -0
  22. package/dist/locales/es.d.ts +4 -0
  23. package/dist/locales/es.d.ts.map +1 -0
  24. package/dist/locales/es.js +9 -0
  25. package/dist/locales/es.js.map +1 -0
  26. package/dist/locales/fr.d.ts +4 -0
  27. package/dist/locales/fr.d.ts.map +1 -0
  28. package/dist/locales/fr.js +9 -0
  29. package/dist/locales/fr.js.map +1 -0
  30. package/dist/locales/it.d.ts +4 -0
  31. package/dist/locales/it.d.ts.map +1 -0
  32. package/dist/locales/it.js +9 -0
  33. package/dist/locales/it.js.map +1 -0
  34. package/dist/locales/ja.d.ts +4 -0
  35. package/dist/locales/ja.d.ts.map +1 -0
  36. package/dist/locales/ja.js +9 -0
  37. package/dist/locales/ja.js.map +1 -0
  38. package/dist/locales/ko.d.ts +4 -0
  39. package/dist/locales/ko.d.ts.map +1 -0
  40. package/dist/locales/ko.js +9 -0
  41. package/dist/locales/ko.js.map +1 -0
  42. package/dist/locales/nl.d.ts +4 -0
  43. package/dist/locales/nl.d.ts.map +1 -0
  44. package/dist/locales/nl.js +9 -0
  45. package/dist/locales/nl.js.map +1 -0
  46. package/dist/locales/pl.d.ts +4 -0
  47. package/dist/locales/pl.d.ts.map +1 -0
  48. package/dist/locales/pl.js +9 -0
  49. package/dist/locales/pl.js.map +1 -0
  50. package/dist/locales/pt.d.ts +4 -0
  51. package/dist/locales/pt.d.ts.map +1 -0
  52. package/dist/locales/pt.js +9 -0
  53. package/dist/locales/pt.js.map +1 -0
  54. package/dist/locales/zh-CN.d.ts +4 -0
  55. package/dist/locales/zh-CN.d.ts.map +1 -0
  56. package/dist/locales/zh-CN.js +9 -0
  57. package/dist/locales/zh-CN.js.map +1 -0
  58. package/dist/locales/zh-TW.d.ts +4 -0
  59. package/dist/locales/zh-TW.d.ts.map +1 -0
  60. package/dist/locales/zh-TW.js +9 -0
  61. package/dist/locales/zh-TW.js.map +1 -0
  62. package/package.json +34 -3
  63. package/README.md +0 -3
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Rexezuge
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,87 @@
1
+ /**
2
+ * The key/type source of truth for every localized backend string.
3
+ *
4
+ * ## Provenance
5
+ *
6
+ * Distilled from `packages/shared/src/i18n/BackendStrings.ts` across the
7
+ * consumer repos, comparing them one by one:
8
+ *
9
+ * - **Durable-DAV** — the canonical base. Its `AGENTS.md` pins backend strings
10
+ * to `packages/shared/src/i18n`, and it is the copy that *deliberately*
11
+ * shrunk: the `repo`/`token`/`issue`/`git`/`namespace` groups, 15 keys across
12
+ * 12 locales (~60 translated strings), were deleted because no production
13
+ * code path ever read them and `validate_locales.mjs` failed CI on a missing
14
+ * translation of a key nothing could emit.
15
+ * - **Durable-DAV-Router** — same twelve locales, same `common` group, same
16
+ * fallback chain, plus a `resolveLocalizedStrings(locale, fallback)` chain
17
+ * and a `formatBackendString` interpolator (its own data is gone, so that
18
+ * interpolator is residue here too).
19
+ * - **Edge-Git** — same twelve locales and same three `common` strings, but it
20
+ * still carries the five groups Durable-DAV deleted, and its bundle is
21
+ * therefore the only one with `{placeholder}` values.
22
+ * - **Mail-Otter** — same twelve locales, an entirely different product
23
+ * bundle (digest/actionPage/summary/chat/tracking/notify/results/csv). No
24
+ * overlap with the `common` group at all.
25
+ * - **Edge-Sonic** — partial: an English-only single-file bundle with one
26
+ * flattened `common` group of eight keys. Noted, not ported.
27
+ *
28
+ * Durable-DAV's set wins, so `common` with three keys is the canonical
29
+ * bundle: three repos ship those three strings identically, a fourth ships
30
+ * them plus five unreachable groups, and the fifth ships something else
31
+ * entirely.
32
+ *
33
+ * ## Self-contained
34
+ *
35
+ * The source repos import `canonicalizeLanguageTag` from
36
+ * `shared/utils/LanguageTag`. This package has zero runtime dependencies, so
37
+ * that one function is inlined below rather than re-exported from a sibling
38
+ * kit package — the tag grammar is small, fixed, and testable here.
39
+ */
40
+ /** Every locale the bundle ships. `en` is the fallback and is never empty. */
41
+ declare const SUPPORTED_LOCALES: readonly ["en", "de", "fr", "es", "it", "nl", "pt", "pl", "ja", "zh-CN", "zh-TW", "ko"];
42
+ /** A locale tag that has a bundle. Anything else resolves through `normalizeLocale`. */
43
+ type SupportedLocale = (typeof SUPPORTED_LOCALES)[number];
44
+ /**
45
+ * Messages a request path can actually emit.
46
+ *
47
+ * The group exists because a route boundary maps a `ServiceError` onto a status
48
+ * and, for the 401/403/500 pair, onto a client-facing sentence. Nothing here is
49
+ * interpolated: a message is either static or comes from the error itself, so a
50
+ * `{placeholder}` would be printed to a client verbatim.
51
+ */
52
+ interface CommonStrings {
53
+ unauthorized: string;
54
+ forbidden: string;
55
+ internalError: string;
56
+ }
57
+ interface BackendStrings {
58
+ common: CommonStrings;
59
+ }
60
+ /**
61
+ * Fold a raw language tag to its canonical form.
62
+ *
63
+ * `_` separators are macOS-style and must not create a distinct tag; the
64
+ * language subtag is lowercase and any two-letter region is uppercase, which
65
+ * is what makes `zh_cn`, `ZH-CN` and `zh-CN` the *same* tag before any bundle
66
+ * lookup happens. A tag that is only separators is `en`, not an empty string.
67
+ */
68
+ declare function canonicalizeLanguageTag(tag: string): string;
69
+ /**
70
+ * Resolve any tag — or nothing at all — to a locale that has a bundle.
71
+ *
72
+ * The fallback rules, in order:
73
+ *
74
+ * 1. Nothing, or not a string, is `en`. A missing `Accept-Language` and a
75
+ * corrupt one must not diverge.
76
+ * 2. An exact canonical hit wins, so `zh-CN` stays distinct from `zh-TW`.
77
+ * 3. `zh` — and any other `zh-*` region — collapses to `zh-CN`. It is the
78
+ * default Simplified bundle, which is what `zh` means to a client that
79
+ * sends the bare language subtag.
80
+ * 4. A base-language match maps a regional variant onto its language bundle:
81
+ * `de-AT` is `de`, `pt-BR` is `pt`. A wrong-but-close locale is worse than
82
+ * an honest fallback, but an unrelated one (`xx`) is not mapped at all.
83
+ */
84
+ declare function normalizeLocale(locale: string | null | undefined): SupportedLocale;
85
+ export { SUPPORTED_LOCALES, canonicalizeLanguageTag, normalizeLocale };
86
+ export type { BackendStrings, CommonStrings, SupportedLocale };
87
+ //# sourceMappingURL=BackendStrings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BackendStrings.d.ts","sourceRoot":"","sources":["../src/BackendStrings.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEH,8EAA8E;AAC9E,QAAA,MAAM,iBAAiB,yFAA0F,CAAC;AAElH,wFAAwF;AACxF,KAAK,eAAe,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE1D;;;;;;;GAOG;AACH,UAAU,aAAa;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,UAAU,cAAc;IACtB,MAAM,EAAE,aAAa,CAAC;CACvB;AAED;;;;;;;GAOG;AACH,iBAAS,uBAAuB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAQpD;AAED;;;;;;;;;;;;;;GAcG;AACH,iBAAS,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,eAAe,CAU3E;AAED,OAAO,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,eAAe,EAAE,CAAC;AACvE,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,eAAe,EAAE,CAAC"}
@@ -0,0 +1,90 @@
1
+ /**
2
+ * The key/type source of truth for every localized backend string.
3
+ *
4
+ * ## Provenance
5
+ *
6
+ * Distilled from `packages/shared/src/i18n/BackendStrings.ts` across the
7
+ * consumer repos, comparing them one by one:
8
+ *
9
+ * - **Durable-DAV** — the canonical base. Its `AGENTS.md` pins backend strings
10
+ * to `packages/shared/src/i18n`, and it is the copy that *deliberately*
11
+ * shrunk: the `repo`/`token`/`issue`/`git`/`namespace` groups, 15 keys across
12
+ * 12 locales (~60 translated strings), were deleted because no production
13
+ * code path ever read them and `validate_locales.mjs` failed CI on a missing
14
+ * translation of a key nothing could emit.
15
+ * - **Durable-DAV-Router** — same twelve locales, same `common` group, same
16
+ * fallback chain, plus a `resolveLocalizedStrings(locale, fallback)` chain
17
+ * and a `formatBackendString` interpolator (its own data is gone, so that
18
+ * interpolator is residue here too).
19
+ * - **Edge-Git** — same twelve locales and same three `common` strings, but it
20
+ * still carries the five groups Durable-DAV deleted, and its bundle is
21
+ * therefore the only one with `{placeholder}` values.
22
+ * - **Mail-Otter** — same twelve locales, an entirely different product
23
+ * bundle (digest/actionPage/summary/chat/tracking/notify/results/csv). No
24
+ * overlap with the `common` group at all.
25
+ * - **Edge-Sonic** — partial: an English-only single-file bundle with one
26
+ * flattened `common` group of eight keys. Noted, not ported.
27
+ *
28
+ * Durable-DAV's set wins, so `common` with three keys is the canonical
29
+ * bundle: three repos ship those three strings identically, a fourth ships
30
+ * them plus five unreachable groups, and the fifth ships something else
31
+ * entirely.
32
+ *
33
+ * ## Self-contained
34
+ *
35
+ * The source repos import `canonicalizeLanguageTag` from
36
+ * `shared/utils/LanguageTag`. This package has zero runtime dependencies, so
37
+ * that one function is inlined below rather than re-exported from a sibling
38
+ * kit package — the tag grammar is small, fixed, and testable here.
39
+ */
40
+ /** Every locale the bundle ships. `en` is the fallback and is never empty. */
41
+ const SUPPORTED_LOCALES = ['en', 'de', 'fr', 'es', 'it', 'nl', 'pt', 'pl', 'ja', 'zh-CN', 'zh-TW', 'ko'];
42
+ /**
43
+ * Fold a raw language tag to its canonical form.
44
+ *
45
+ * `_` separators are macOS-style and must not create a distinct tag; the
46
+ * language subtag is lowercase and any two-letter region is uppercase, which
47
+ * is what makes `zh_cn`, `ZH-CN` and `zh-CN` the *same* tag before any bundle
48
+ * lookup happens. A tag that is only separators is `en`, not an empty string.
49
+ */
50
+ function canonicalizeLanguageTag(tag) {
51
+ const normalized = tag.trim().replaceAll('_', '-');
52
+ const parts = normalized.split('-').filter(Boolean);
53
+ if (parts.length === 0)
54
+ return 'en';
55
+ const language = (parts[0] ?? 'en').toLowerCase();
56
+ if (parts.length === 1)
57
+ return language;
58
+ const rest = parts.slice(1).map((part) => (part.length === 2 ? part.toUpperCase() : part.toLowerCase()));
59
+ return [language, ...rest].join('-');
60
+ }
61
+ /**
62
+ * Resolve any tag — or nothing at all — to a locale that has a bundle.
63
+ *
64
+ * The fallback rules, in order:
65
+ *
66
+ * 1. Nothing, or not a string, is `en`. A missing `Accept-Language` and a
67
+ * corrupt one must not diverge.
68
+ * 2. An exact canonical hit wins, so `zh-CN` stays distinct from `zh-TW`.
69
+ * 3. `zh` — and any other `zh-*` region — collapses to `zh-CN`. It is the
70
+ * default Simplified bundle, which is what `zh` means to a client that
71
+ * sends the bare language subtag.
72
+ * 4. A base-language match maps a regional variant onto its language bundle:
73
+ * `de-AT` is `de`, `pt-BR` is `pt`. A wrong-but-close locale is worse than
74
+ * an honest fallback, but an unrelated one (`xx`) is not mapped at all.
75
+ */
76
+ function normalizeLocale(locale) {
77
+ if (!locale || typeof locale !== 'string')
78
+ return 'en';
79
+ const canonical = canonicalizeLanguageTag(locale);
80
+ if (SUPPORTED_LOCALES.includes(canonical)) {
81
+ return canonical;
82
+ }
83
+ const base = canonical.split('-', 1)[0]?.toLowerCase() ?? 'en';
84
+ if (base === 'zh')
85
+ return 'zh-CN';
86
+ const match = SUPPORTED_LOCALES.find((l) => l.toLowerCase() === base);
87
+ return (match || 'en');
88
+ }
89
+ export { SUPPORTED_LOCALES, canonicalizeLanguageTag, normalizeLocale };
90
+ //# sourceMappingURL=BackendStrings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BackendStrings.js","sourceRoot":"","sources":["../src/BackendStrings.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEH,8EAA8E;AAC9E,MAAM,iBAAiB,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,CAAU,CAAC;AAuBlH;;;;;;;GAOG;AACH,SAAS,uBAAuB,CAAC,GAAW;IAC1C,MAAM,UAAU,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACnD,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACpD,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACpC,MAAM,QAAQ,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC;IAClD,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,QAAQ,CAAC;IACxC,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;IACzG,OAAO,CAAC,QAAQ,EAAE,GAAG,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACvC,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,SAAS,eAAe,CAAC,MAAiC;IACxD,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC;IACvD,MAAM,SAAS,GAAG,uBAAuB,CAAC,MAAM,CAAC,CAAC;IAClD,IAAK,iBAAuC,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;QACjE,OAAO,SAA4B,CAAC;IACtC,CAAC;IACD,MAAM,IAAI,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,IAAI,IAAI,CAAC;IAC/D,IAAI,IAAI,KAAK,IAAI;QAAE,OAAO,OAAO,CAAC;IAClC,MAAM,KAAK,GAAI,iBAAuC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,KAAK,IAAI,CAAC,CAAC;IAC7F,OAAO,CAAC,KAAK,IAAI,IAAI,CAAoB,CAAC;AAC5C,CAAC;AAED,OAAO,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,eAAe,EAAE,CAAC"}
@@ -0,0 +1,32 @@
1
+ import type { BackendStrings, SupportedLocale } from './BackendStrings';
2
+ /**
3
+ * The twelve bundles, keyed by locale.
4
+ *
5
+ * Typed as a total `Record` rather than a partial map with a `??` at the read
6
+ * site: adding a locale to `SUPPORTED_LOCALES` without adding a bundle is a
7
+ * compile error here instead of a runtime `undefined` string at the boundary.
8
+ */
9
+ declare const LOCALE_STRINGS: Record<SupportedLocale, BackendStrings>;
10
+ /**
11
+ * Look up the bundle for a language tag.
12
+ *
13
+ * `null`/`undefined`/`""`/unknown all land on `en` through `normalizeLocale`,
14
+ * so a caller cannot get `undefined` back and never has to guard the read.
15
+ * Prefer this over indexing `LOCALE_STRINGS` directly — the index would happily
16
+ * return `undefined` for a tag that has no bundle.
17
+ */
18
+ declare function getLocalizedStrings(locale: string | null | undefined): BackendStrings;
19
+ /**
20
+ * Look up a bundle, falling back to a second preference before `en`.
21
+ *
22
+ * This is the `Accept-Language` plus stored-user-preference pair: the header is
23
+ * what the *client* sent this request, the stored preference is what the user
24
+ * chose once. The stored preference only speaks when the header does not
25
+ * express a real choice, which is what `primary === 'en'` means — an explicit
26
+ * `en` header and an absent header are indistinguishable to this resolver, and
27
+ * that is deliberate, because a browser that sends `en` while the user picked
28
+ * `ja` should still get `ja`.
29
+ */
30
+ declare function resolveLocalizedStrings(locale?: string | null, fallback?: string | null): BackendStrings;
31
+ export { LOCALE_STRINGS, getLocalizedStrings, resolveLocalizedStrings };
32
+ //# sourceMappingURL=getLocalizedStrings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getLocalizedStrings.d.ts","sourceRoot":"","sources":["../src/getLocalizedStrings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAexE;;;;;;GAMG;AACH,QAAA,MAAM,cAAc,EAAE,MAAM,CAAC,eAAe,EAAE,cAAc,CAa3D,CAAC;AAEF;;;;;;;GAOG;AACH,iBAAS,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,cAAc,CAE9E;AAED;;;;;;;;;;GAUG;AACH,iBAAS,uBAAuB,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,cAAc,CAGjG;AAED,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,CAAC"}
@@ -0,0 +1,62 @@
1
+ import { normalizeLocale } from './BackendStrings';
2
+ import { deStrings } from './locales/de';
3
+ import { enStrings } from './locales/en';
4
+ import { esStrings } from './locales/es';
5
+ import { frStrings } from './locales/fr';
6
+ import { itStrings } from './locales/it';
7
+ import { jaStrings } from './locales/ja';
8
+ import { koStrings } from './locales/ko';
9
+ import { nlStrings } from './locales/nl';
10
+ import { plStrings } from './locales/pl';
11
+ import { ptStrings } from './locales/pt';
12
+ import { zhCNStrings } from './locales/zh-CN';
13
+ import { zhTWStrings } from './locales/zh-TW';
14
+ /**
15
+ * The twelve bundles, keyed by locale.
16
+ *
17
+ * Typed as a total `Record` rather than a partial map with a `??` at the read
18
+ * site: adding a locale to `SUPPORTED_LOCALES` without adding a bundle is a
19
+ * compile error here instead of a runtime `undefined` string at the boundary.
20
+ */
21
+ const LOCALE_STRINGS = {
22
+ en: enStrings,
23
+ de: deStrings,
24
+ fr: frStrings,
25
+ es: esStrings,
26
+ it: itStrings,
27
+ nl: nlStrings,
28
+ pt: ptStrings,
29
+ pl: plStrings,
30
+ ja: jaStrings,
31
+ 'zh-CN': zhCNStrings,
32
+ 'zh-TW': zhTWStrings,
33
+ ko: koStrings,
34
+ };
35
+ /**
36
+ * Look up the bundle for a language tag.
37
+ *
38
+ * `null`/`undefined`/`""`/unknown all land on `en` through `normalizeLocale`,
39
+ * so a caller cannot get `undefined` back and never has to guard the read.
40
+ * Prefer this over indexing `LOCALE_STRINGS` directly — the index would happily
41
+ * return `undefined` for a tag that has no bundle.
42
+ */
43
+ function getLocalizedStrings(locale) {
44
+ return LOCALE_STRINGS[normalizeLocale(locale)];
45
+ }
46
+ /**
47
+ * Look up a bundle, falling back to a second preference before `en`.
48
+ *
49
+ * This is the `Accept-Language` plus stored-user-preference pair: the header is
50
+ * what the *client* sent this request, the stored preference is what the user
51
+ * chose once. The stored preference only speaks when the header does not
52
+ * express a real choice, which is what `primary === 'en'` means — an explicit
53
+ * `en` header and an absent header are indistinguishable to this resolver, and
54
+ * that is deliberate, because a browser that sends `en` while the user picked
55
+ * `ja` should still get `ja`.
56
+ */
57
+ function resolveLocalizedStrings(locale, fallback) {
58
+ const primary = normalizeLocale(locale);
59
+ return getLocalizedStrings(primary === 'en' ? normalizeLocale(fallback) : primary);
60
+ }
61
+ export { LOCALE_STRINGS, getLocalizedStrings, resolveLocalizedStrings };
62
+ //# sourceMappingURL=getLocalizedStrings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getLocalizedStrings.js","sourceRoot":"","sources":["../src/getLocalizedStrings.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C;;;;;;GAMG;AACH,MAAM,cAAc,GAA4C;IAC9D,EAAE,EAAE,SAAS;IACb,EAAE,EAAE,SAAS;IACb,EAAE,EAAE,SAAS;IACb,EAAE,EAAE,SAAS;IACb,EAAE,EAAE,SAAS;IACb,EAAE,EAAE,SAAS;IACb,EAAE,EAAE,SAAS;IACb,EAAE,EAAE,SAAS;IACb,EAAE,EAAE,SAAS;IACb,OAAO,EAAE,WAAW;IACpB,OAAO,EAAE,WAAW;IACpB,EAAE,EAAE,SAAS;CACd,CAAC;AAEF;;;;;;;GAOG;AACH,SAAS,mBAAmB,CAAC,MAAiC;IAC5D,OAAO,cAAc,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC;AACjD,CAAC;AAED;;;;;;;;;;GAUG;AACH,SAAS,uBAAuB,CAAC,MAAsB,EAAE,QAAwB;IAC/E,MAAM,OAAO,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;IACxC,OAAO,mBAAmB,CAAC,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;AACrF,CAAC;AAED,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,CAAC"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * `@rexezuge/i18n` — the backend string bundle and its twelve locales.
3
+ *
4
+ * Zero runtime dependencies. The bundle is one `common` group of three keys
5
+ * (see `BackendStrings.ts` for the provenance and for why the `repo`/`token`/
6
+ * `git` groups are not here); the locale table, the fallback chain, and the
7
+ * lookup are the parts every consumer boundary needs.
8
+ */
9
+ export { SUPPORTED_LOCALES, canonicalizeLanguageTag, normalizeLocale } from './BackendStrings';
10
+ export type { BackendStrings, CommonStrings, SupportedLocale } from './BackendStrings';
11
+ export { LOCALE_STRINGS, getLocalizedStrings, resolveLocalizedStrings } from './getLocalizedStrings';
12
+ export { deStrings } from './locales/de';
13
+ export { enStrings } from './locales/en';
14
+ export { esStrings } from './locales/es';
15
+ export { frStrings } from './locales/fr';
16
+ export { itStrings } from './locales/it';
17
+ export { jaStrings } from './locales/ja';
18
+ export { koStrings } from './locales/ko';
19
+ export { nlStrings } from './locales/nl';
20
+ export { plStrings } from './locales/pl';
21
+ export { ptStrings } from './locales/pt';
22
+ export { zhCNStrings } from './locales/zh-CN';
23
+ export { zhTWStrings } from './locales/zh-TW';
24
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAC/F,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACvF,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAKrG,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,26 @@
1
+ /**
2
+ * `@rexezuge/i18n` — the backend string bundle and its twelve locales.
3
+ *
4
+ * Zero runtime dependencies. The bundle is one `common` group of three keys
5
+ * (see `BackendStrings.ts` for the provenance and for why the `repo`/`token`/
6
+ * `git` groups are not here); the locale table, the fallback chain, and the
7
+ * lookup are the parts every consumer boundary needs.
8
+ */
9
+ export { SUPPORTED_LOCALES, canonicalizeLanguageTag, normalizeLocale } from './BackendStrings';
10
+ export { LOCALE_STRINGS, getLocalizedStrings, resolveLocalizedStrings } from './getLocalizedStrings';
11
+ // The bundles themselves, exported so a consumer can read one directly (a
12
+ // migration script, a test, a bundle-level integrity check) without reaching
13
+ // through the table.
14
+ export { deStrings } from './locales/de';
15
+ export { enStrings } from './locales/en';
16
+ export { esStrings } from './locales/es';
17
+ export { frStrings } from './locales/fr';
18
+ export { itStrings } from './locales/it';
19
+ export { jaStrings } from './locales/ja';
20
+ export { koStrings } from './locales/ko';
21
+ export { nlStrings } from './locales/nl';
22
+ export { plStrings } from './locales/pl';
23
+ export { ptStrings } from './locales/pt';
24
+ export { zhCNStrings } from './locales/zh-CN';
25
+ export { zhTWStrings } from './locales/zh-TW';
26
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAE/F,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAErG,0EAA0E;AAC1E,6EAA6E;AAC7E,qBAAqB;AACrB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { BackendStrings } from '../BackendStrings';
2
+ declare const deStrings: BackendStrings;
3
+ export { deStrings };
4
+ //# sourceMappingURL=de.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"de.d.ts","sourceRoot":"","sources":["../../src/locales/de.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,QAAA,MAAM,SAAS,EAAE,cAMhB,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,CAAC"}
@@ -0,0 +1,9 @@
1
+ const deStrings = {
2
+ common: {
3
+ unauthorized: 'Authentifizierung Erforderlich.',
4
+ forbidden: 'Zugriff Verweigert.',
5
+ internalError: 'Interner Serverfehler.',
6
+ },
7
+ };
8
+ export { deStrings };
9
+ //# sourceMappingURL=de.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"de.js","sourceRoot":"","sources":["../../src/locales/de.ts"],"names":[],"mappings":"AAEA,MAAM,SAAS,GAAmB;IAChC,MAAM,EAAE;QACN,YAAY,EAAE,iCAAiC;QAC/C,SAAS,EAAE,qBAAqB;QAChC,aAAa,EAAE,wBAAwB;KACxC;CACF,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { BackendStrings } from '../BackendStrings';
2
+ declare const enStrings: BackendStrings;
3
+ export { enStrings };
4
+ //# sourceMappingURL=en.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../src/locales/en.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,QAAA,MAAM,SAAS,EAAE,cAMhB,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,CAAC"}
@@ -0,0 +1,9 @@
1
+ const enStrings = {
2
+ common: {
3
+ unauthorized: 'Authentication Required.',
4
+ forbidden: 'Access Denied.',
5
+ internalError: 'Internal Server Error.',
6
+ },
7
+ };
8
+ export { enStrings };
9
+ //# sourceMappingURL=en.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"en.js","sourceRoot":"","sources":["../../src/locales/en.ts"],"names":[],"mappings":"AAEA,MAAM,SAAS,GAAmB;IAChC,MAAM,EAAE;QACN,YAAY,EAAE,0BAA0B;QACxC,SAAS,EAAE,gBAAgB;QAC3B,aAAa,EAAE,wBAAwB;KACxC;CACF,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { BackendStrings } from '../BackendStrings';
2
+ declare const esStrings: BackendStrings;
3
+ export { esStrings };
4
+ //# sourceMappingURL=es.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"es.d.ts","sourceRoot":"","sources":["../../src/locales/es.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,QAAA,MAAM,SAAS,EAAE,cAMhB,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,CAAC"}
@@ -0,0 +1,9 @@
1
+ const esStrings = {
2
+ common: {
3
+ unauthorized: 'Autenticación Requerida.',
4
+ forbidden: 'Acceso Denegado.',
5
+ internalError: 'Error Interno Del Servidor.',
6
+ },
7
+ };
8
+ export { esStrings };
9
+ //# sourceMappingURL=es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"es.js","sourceRoot":"","sources":["../../src/locales/es.ts"],"names":[],"mappings":"AAEA,MAAM,SAAS,GAAmB;IAChC,MAAM,EAAE;QACN,YAAY,EAAE,0BAA0B;QACxC,SAAS,EAAE,kBAAkB;QAC7B,aAAa,EAAE,6BAA6B;KAC7C;CACF,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { BackendStrings } from '../BackendStrings';
2
+ declare const frStrings: BackendStrings;
3
+ export { frStrings };
4
+ //# sourceMappingURL=fr.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fr.d.ts","sourceRoot":"","sources":["../../src/locales/fr.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,QAAA,MAAM,SAAS,EAAE,cAMhB,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,CAAC"}
@@ -0,0 +1,9 @@
1
+ const frStrings = {
2
+ common: {
3
+ unauthorized: 'Authentification Requise.',
4
+ forbidden: 'Accès Refusé.',
5
+ internalError: 'Erreur Interne Du Serveur.',
6
+ },
7
+ };
8
+ export { frStrings };
9
+ //# sourceMappingURL=fr.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fr.js","sourceRoot":"","sources":["../../src/locales/fr.ts"],"names":[],"mappings":"AAEA,MAAM,SAAS,GAAmB;IAChC,MAAM,EAAE;QACN,YAAY,EAAE,2BAA2B;QACzC,SAAS,EAAE,eAAe;QAC1B,aAAa,EAAE,4BAA4B;KAC5C;CACF,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { BackendStrings } from '../BackendStrings';
2
+ declare const itStrings: BackendStrings;
3
+ export { itStrings };
4
+ //# sourceMappingURL=it.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"it.d.ts","sourceRoot":"","sources":["../../src/locales/it.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,QAAA,MAAM,SAAS,EAAE,cAMhB,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,CAAC"}
@@ -0,0 +1,9 @@
1
+ const itStrings = {
2
+ common: {
3
+ unauthorized: 'Autenticazione Richiesta.',
4
+ forbidden: 'Accesso Negato.',
5
+ internalError: 'Errore Interno Del Server.',
6
+ },
7
+ };
8
+ export { itStrings };
9
+ //# sourceMappingURL=it.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"it.js","sourceRoot":"","sources":["../../src/locales/it.ts"],"names":[],"mappings":"AAEA,MAAM,SAAS,GAAmB;IAChC,MAAM,EAAE;QACN,YAAY,EAAE,2BAA2B;QACzC,SAAS,EAAE,iBAAiB;QAC5B,aAAa,EAAE,4BAA4B;KAC5C;CACF,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { BackendStrings } from '../BackendStrings';
2
+ declare const jaStrings: BackendStrings;
3
+ export { jaStrings };
4
+ //# sourceMappingURL=ja.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ja.d.ts","sourceRoot":"","sources":["../../src/locales/ja.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,QAAA,MAAM,SAAS,EAAE,cAMhB,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,CAAC"}
@@ -0,0 +1,9 @@
1
+ const jaStrings = {
2
+ common: {
3
+ unauthorized: '認証が必要です。',
4
+ forbidden: 'アクセスが拒否されました。',
5
+ internalError: 'サーバー内部エラー。',
6
+ },
7
+ };
8
+ export { jaStrings };
9
+ //# sourceMappingURL=ja.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ja.js","sourceRoot":"","sources":["../../src/locales/ja.ts"],"names":[],"mappings":"AAEA,MAAM,SAAS,GAAmB;IAChC,MAAM,EAAE;QACN,YAAY,EAAE,UAAU;QACxB,SAAS,EAAE,eAAe;QAC1B,aAAa,EAAE,YAAY;KAC5B;CACF,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { BackendStrings } from '../BackendStrings';
2
+ declare const koStrings: BackendStrings;
3
+ export { koStrings };
4
+ //# sourceMappingURL=ko.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ko.d.ts","sourceRoot":"","sources":["../../src/locales/ko.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,QAAA,MAAM,SAAS,EAAE,cAMhB,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,CAAC"}
@@ -0,0 +1,9 @@
1
+ const koStrings = {
2
+ common: {
3
+ unauthorized: '인증이 필요합니다.',
4
+ forbidden: '액세스가 거부되었습니다.',
5
+ internalError: '서버 내부 오류.',
6
+ },
7
+ };
8
+ export { koStrings };
9
+ //# sourceMappingURL=ko.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ko.js","sourceRoot":"","sources":["../../src/locales/ko.ts"],"names":[],"mappings":"AAEA,MAAM,SAAS,GAAmB;IAChC,MAAM,EAAE;QACN,YAAY,EAAE,YAAY;QAC1B,SAAS,EAAE,eAAe;QAC1B,aAAa,EAAE,WAAW;KAC3B;CACF,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { BackendStrings } from '../BackendStrings';
2
+ declare const nlStrings: BackendStrings;
3
+ export { nlStrings };
4
+ //# sourceMappingURL=nl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nl.d.ts","sourceRoot":"","sources":["../../src/locales/nl.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,QAAA,MAAM,SAAS,EAAE,cAMhB,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,CAAC"}
@@ -0,0 +1,9 @@
1
+ const nlStrings = {
2
+ common: {
3
+ unauthorized: 'Authenticatie Vereist.',
4
+ forbidden: 'Toegang Geweigerd.',
5
+ internalError: 'Interne Serverfout.',
6
+ },
7
+ };
8
+ export { nlStrings };
9
+ //# sourceMappingURL=nl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nl.js","sourceRoot":"","sources":["../../src/locales/nl.ts"],"names":[],"mappings":"AAEA,MAAM,SAAS,GAAmB;IAChC,MAAM,EAAE;QACN,YAAY,EAAE,wBAAwB;QACtC,SAAS,EAAE,oBAAoB;QAC/B,aAAa,EAAE,qBAAqB;KACrC;CACF,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { BackendStrings } from '../BackendStrings';
2
+ declare const plStrings: BackendStrings;
3
+ export { plStrings };
4
+ //# sourceMappingURL=pl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pl.d.ts","sourceRoot":"","sources":["../../src/locales/pl.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,QAAA,MAAM,SAAS,EAAE,cAMhB,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,CAAC"}
@@ -0,0 +1,9 @@
1
+ const plStrings = {
2
+ common: {
3
+ unauthorized: 'Wymagana Autoryzacja.',
4
+ forbidden: 'Odmowa Dostępu.',
5
+ internalError: 'Wewnętrzny Błąd Serwera.',
6
+ },
7
+ };
8
+ export { plStrings };
9
+ //# sourceMappingURL=pl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pl.js","sourceRoot":"","sources":["../../src/locales/pl.ts"],"names":[],"mappings":"AAEA,MAAM,SAAS,GAAmB;IAChC,MAAM,EAAE;QACN,YAAY,EAAE,uBAAuB;QACrC,SAAS,EAAE,iBAAiB;QAC5B,aAAa,EAAE,0BAA0B;KAC1C;CACF,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { BackendStrings } from '../BackendStrings';
2
+ declare const ptStrings: BackendStrings;
3
+ export { ptStrings };
4
+ //# sourceMappingURL=pt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pt.d.ts","sourceRoot":"","sources":["../../src/locales/pt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,QAAA,MAAM,SAAS,EAAE,cAMhB,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,CAAC"}
@@ -0,0 +1,9 @@
1
+ const ptStrings = {
2
+ common: {
3
+ unauthorized: 'Autenticação Necessária.',
4
+ forbidden: 'Acesso Negado.',
5
+ internalError: 'Erro Interno Do Servidor.',
6
+ },
7
+ };
8
+ export { ptStrings };
9
+ //# sourceMappingURL=pt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pt.js","sourceRoot":"","sources":["../../src/locales/pt.ts"],"names":[],"mappings":"AAEA,MAAM,SAAS,GAAmB;IAChC,MAAM,EAAE;QACN,YAAY,EAAE,0BAA0B;QACxC,SAAS,EAAE,gBAAgB;QAC3B,aAAa,EAAE,2BAA2B;KAC3C;CACF,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { BackendStrings } from '../BackendStrings';
2
+ declare const zhCNStrings: BackendStrings;
3
+ export { zhCNStrings };
4
+ //# sourceMappingURL=zh-CN.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zh-CN.d.ts","sourceRoot":"","sources":["../../src/locales/zh-CN.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,QAAA,MAAM,WAAW,EAAE,cAMlB,CAAC;AAEF,OAAO,EAAE,WAAW,EAAE,CAAC"}
@@ -0,0 +1,9 @@
1
+ const zhCNStrings = {
2
+ common: {
3
+ unauthorized: '需要身份验证。',
4
+ forbidden: '访问被拒绝。',
5
+ internalError: '服务器内部错误。',
6
+ },
7
+ };
8
+ export { zhCNStrings };
9
+ //# sourceMappingURL=zh-CN.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zh-CN.js","sourceRoot":"","sources":["../../src/locales/zh-CN.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,GAAmB;IAClC,MAAM,EAAE;QACN,YAAY,EAAE,SAAS;QACvB,SAAS,EAAE,QAAQ;QACnB,aAAa,EAAE,UAAU;KAC1B;CACF,CAAC;AAEF,OAAO,EAAE,WAAW,EAAE,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { BackendStrings } from '../BackendStrings';
2
+ declare const zhTWStrings: BackendStrings;
3
+ export { zhTWStrings };
4
+ //# sourceMappingURL=zh-TW.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zh-TW.d.ts","sourceRoot":"","sources":["../../src/locales/zh-TW.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,QAAA,MAAM,WAAW,EAAE,cAMlB,CAAC;AAEF,OAAO,EAAE,WAAW,EAAE,CAAC"}
@@ -0,0 +1,9 @@
1
+ const zhTWStrings = {
2
+ common: {
3
+ unauthorized: '需要驗證。',
4
+ forbidden: '存取被拒絕。',
5
+ internalError: '伺服器內部錯誤。',
6
+ },
7
+ };
8
+ export { zhTWStrings };
9
+ //# sourceMappingURL=zh-TW.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zh-TW.js","sourceRoot":"","sources":["../../src/locales/zh-TW.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,GAAmB;IAClC,MAAM,EAAE;QACN,YAAY,EAAE,OAAO;QACrB,SAAS,EAAE,QAAQ;QACnB,aAAa,EAAE,UAAU;KAC1B;CACF,CAAC;AAEF,OAAO,EAAE,WAAW,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,37 @@
1
1
  {
2
2
  "name": "@rexezuge/i18n",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "1.0.0",
4
+ "private": false,
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/Rexezuge-CloudflareWorkers/SDK.git",
9
+ "directory": "packages/i18n"
10
+ },
11
+ "type": "module",
12
+ "main": "./dist/index.js",
13
+ "types": "./dist/index.d.ts",
14
+ "exports": {
15
+ ".": {
16
+ "types": "./dist/index.d.ts",
17
+ "default": "./dist/index.js"
18
+ },
19
+ "./*": {
20
+ "types": "./dist/*.d.ts",
21
+ "default": "./dist/*.js"
22
+ }
23
+ },
24
+ "files": [
25
+ "dist"
26
+ ],
27
+ "devDependencies": {
28
+ "@types/node": "26.6.4",
29
+ "typescript": "6.0.3",
30
+ "vitest": "4.1.11"
31
+ },
32
+ "scripts": {
33
+ "build": "tsc -p tsconfig.json",
34
+ "typecheck": "tsc -p tsconfig.test.json --noEmit",
35
+ "test": "vitest run"
36
+ }
6
37
  }
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.