@adminiumjs/i18n 0.1.2 → 0.2.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.
Files changed (135) hide show
  1. package/dist/a11y-keys.d.ts +17 -0
  2. package/dist/a11y-keys.d.ts.map +1 -0
  3. package/dist/a11y-keys.js +478 -0
  4. package/dist/a11y-keys.js.map +1 -0
  5. package/dist/create-i18n.d.ts.map +1 -1
  6. package/dist/create-i18n.js +37 -4
  7. package/dist/create-i18n.js.map +1 -1
  8. package/dist/editing.d.ts +17 -0
  9. package/dist/editing.d.ts.map +1 -0
  10. package/dist/editing.js +16 -0
  11. package/dist/editing.js.map +1 -0
  12. package/dist/fallback.d.ts +24 -0
  13. package/dist/fallback.d.ts.map +1 -0
  14. package/dist/fallback.js +40 -0
  15. package/dist/fallback.js.map +1 -0
  16. package/dist/format-errors.d.ts +41 -0
  17. package/dist/format-errors.d.ts.map +1 -0
  18. package/dist/format-errors.js +63 -0
  19. package/dist/format-errors.js.map +1 -0
  20. package/dist/icu-format.d.ts +4 -0
  21. package/dist/icu-format.d.ts.map +1 -1
  22. package/dist/icu-format.js +43 -3
  23. package/dist/icu-format.js.map +1 -1
  24. package/dist/index.d.ts +10 -2
  25. package/dist/index.d.ts.map +1 -1
  26. package/dist/index.js +14 -1
  27. package/dist/index.js.map +1 -1
  28. package/dist/keys.d.ts +33 -0
  29. package/dist/keys.d.ts.map +1 -0
  30. package/dist/keys.js +77 -0
  31. package/dist/keys.js.map +1 -0
  32. package/dist/locales.d.ts +102 -13
  33. package/dist/locales.d.ts.map +1 -1
  34. package/dist/locales.js +142 -17
  35. package/dist/locales.js.map +1 -1
  36. package/dist/overrides.d.ts +62 -0
  37. package/dist/overrides.d.ts.map +1 -0
  38. package/dist/overrides.js +112 -0
  39. package/dist/overrides.js.map +1 -0
  40. package/dist/react.d.ts +6 -0
  41. package/dist/react.d.ts.map +1 -1
  42. package/dist/react.js +17 -26
  43. package/dist/react.js.map +1 -1
  44. package/dist/resources/ar-eg/common.d.ts +96 -0
  45. package/dist/resources/ar-eg/common.d.ts.map +1 -1
  46. package/dist/resources/ar-eg/common.js +103 -7
  47. package/dist/resources/ar-eg/common.js.map +1 -1
  48. package/dist/resources/ar-eg/ui.d.ts +586 -586
  49. package/dist/resources/ar-eg/ui.js +586 -586
  50. package/dist/resources/ar-eg/ui.js.map +1 -1
  51. package/dist/resources/cs-cz/common.d.ts +96 -0
  52. package/dist/resources/cs-cz/common.d.ts.map +1 -1
  53. package/dist/resources/cs-cz/common.js +101 -5
  54. package/dist/resources/cs-cz/common.js.map +1 -1
  55. package/dist/resources/cs-cz/ui.d.ts +582 -582
  56. package/dist/resources/cs-cz/ui.js +582 -582
  57. package/dist/resources/cs-cz/ui.js.map +1 -1
  58. package/dist/resources/da-dk/common.d.ts +97 -1
  59. package/dist/resources/da-dk/common.d.ts.map +1 -1
  60. package/dist/resources/da-dk/common.js +104 -8
  61. package/dist/resources/da-dk/common.js.map +1 -1
  62. package/dist/resources/da-dk/ui.d.ts +568 -568
  63. package/dist/resources/da-dk/ui.js +568 -568
  64. package/dist/resources/da-dk/ui.js.map +1 -1
  65. package/dist/resources/de-de/common.d.ts +100 -4
  66. package/dist/resources/de-de/common.d.ts.map +1 -1
  67. package/dist/resources/de-de/common.js +107 -11
  68. package/dist/resources/de-de/common.js.map +1 -1
  69. package/dist/resources/de-de/ui.d.ts +569 -569
  70. package/dist/resources/de-de/ui.js +569 -569
  71. package/dist/resources/de-de/ui.js.map +1 -1
  72. package/dist/resources/en-us/common.d.ts +96 -0
  73. package/dist/resources/en-us/common.d.ts.map +1 -1
  74. package/dist/resources/en-us/common.js +103 -7
  75. package/dist/resources/en-us/common.js.map +1 -1
  76. package/dist/resources/fr-fr/common.d.ts +98 -2
  77. package/dist/resources/fr-fr/common.d.ts.map +1 -1
  78. package/dist/resources/fr-fr/common.js +105 -9
  79. package/dist/resources/fr-fr/common.js.map +1 -1
  80. package/dist/resources/fr-fr/ui.d.ts +559 -559
  81. package/dist/resources/fr-fr/ui.js +559 -559
  82. package/dist/resources/fr-fr/ui.js.map +1 -1
  83. package/dist/resources/zh-cn/common.d.ts +97 -1
  84. package/dist/resources/zh-cn/common.d.ts.map +1 -1
  85. package/dist/resources/zh-cn/common.js +104 -8
  86. package/dist/resources/zh-cn/common.js.map +1 -1
  87. package/dist/resources/zh-cn/ui.d.ts +575 -575
  88. package/dist/resources/zh-cn/ui.js +575 -575
  89. package/dist/resources/zh-cn/ui.js.map +1 -1
  90. package/dist/resources/zh-tw/common.d.ts +96 -0
  91. package/dist/resources/zh-tw/common.d.ts.map +1 -1
  92. package/dist/resources/zh-tw/common.js +103 -7
  93. package/dist/resources/zh-tw/common.js.map +1 -1
  94. package/dist/resources/zh-tw/ui.d.ts +575 -575
  95. package/dist/resources/zh-tw/ui.js +575 -575
  96. package/dist/resources/zh-tw/ui.js.map +1 -1
  97. package/dist/review-status.d.ts +55 -0
  98. package/dist/review-status.d.ts.map +1 -0
  99. package/dist/review-status.js +59 -0
  100. package/dist/review-status.js.map +1 -0
  101. package/dist/revision.d.ts +35 -0
  102. package/dist/revision.d.ts.map +1 -0
  103. package/dist/revision.js +55 -0
  104. package/dist/revision.js.map +1 -0
  105. package/dist/server.d.ts +36 -0
  106. package/dist/server.d.ts.map +1 -0
  107. package/dist/server.js +35 -0
  108. package/dist/server.js.map +1 -0
  109. package/dist/validate-message.d.ts +57 -0
  110. package/dist/validate-message.d.ts.map +1 -0
  111. package/dist/validate-message.js +178 -0
  112. package/dist/validate-message.js.map +1 -0
  113. package/locales/ar-EG/.meta.json +11134 -0
  114. package/locales/ar-EG/common.json +103 -7
  115. package/locales/ar-EG/ui.json +586 -586
  116. package/locales/cs-CZ/.meta.json +11134 -0
  117. package/locales/cs-CZ/common.json +101 -5
  118. package/locales/cs-CZ/ui.json +582 -582
  119. package/locales/da-DK/.meta.json +11134 -0
  120. package/locales/da-DK/common.json +104 -8
  121. package/locales/da-DK/ui.json +568 -568
  122. package/locales/de-DE/.meta.json +11134 -0
  123. package/locales/de-DE/common.json +107 -11
  124. package/locales/de-DE/ui.json +569 -569
  125. package/locales/en-US/common.json +103 -7
  126. package/locales/fr-FR/.meta.json +11134 -0
  127. package/locales/fr-FR/common.json +105 -9
  128. package/locales/fr-FR/ui.json +559 -559
  129. package/locales/zh-CN/.meta.json +11134 -0
  130. package/locales/zh-CN/common.json +104 -8
  131. package/locales/zh-CN/ui.json +575 -575
  132. package/locales/zh-TW/.meta.json +11134 -0
  133. package/locales/zh-TW/common.json +103 -7
  134. package/locales/zh-TW/ui.json +575 -575
  135. package/package.json +10 -2
@@ -0,0 +1,178 @@
1
+ /**
2
+ * Write-time validation for admin-authored messages
3
+ * (23-runtime-translations.md §6.3).
4
+ *
5
+ * This is the ONLY thing standing between an admin's typing and every user's
6
+ * screen, because once a message comes from the meta store the build-time
7
+ * gates cannot see it (23 §10). It runs in the browser (live editor feedback)
8
+ * and on the server (the real boundary) from this one module, so the two can
9
+ * never disagree about what is acceptable.
10
+ *
11
+ * It parses with `IntlMessageFormat(...).getAst()` — the exact mechanism both
12
+ * `IcuFormat` and the parity gate use — rather than a second parser that
13
+ * could accept what the renderer rejects.
14
+ *
15
+ * The rules are deliberately STRICTER than the compiled-bundle parity gate on
16
+ * one axis: argument TYPE must match the source, not just argument name. That
17
+ * is not pedantry, it is the fix for a real hazard — 48 call sites in this
18
+ * repo do their own `.replace('{count}', …)` on the `t()` result and pass no
19
+ * ICU args at all. For those keys, `format()` throws on the missing variable,
20
+ * the raw string is returned, and the literal `{count}` token is what the
21
+ * `.replace` finds. An override that turned `{count}` into `{count, number}`
22
+ * would pass every name-based check and then render raw ICU to users. Types
23
+ * matching means it cannot.
24
+ */
25
+ import { IntlMessageFormat } from 'intl-messageformat';
26
+ import { intlTagForLocale, pluralCategoriesForLocale } from './locales.js';
27
+ function walk(nodes, shape) {
28
+ for (const node of nodes) {
29
+ if (node.type >= 1 && node.type <= 6 && typeof node.value === 'string') {
30
+ shape.args.set(node.value, node.type);
31
+ }
32
+ if ((node.type === 5 || node.type === 6) && node.options !== undefined) {
33
+ if (node.type === 6 && typeof node.value === 'string') {
34
+ shape.plurals.set(node.value, Object.keys(node.options).sort());
35
+ }
36
+ for (const option of Object.values(node.options))
37
+ walk(option.value, shape);
38
+ }
39
+ if (node.children !== undefined)
40
+ walk(node.children, shape);
41
+ }
42
+ }
43
+ /** Parse + extract, keeping the parser's reason so the admin gets a real message. */
44
+ function shapeOf(message, intlTag) {
45
+ const shape = { args: new Map(), plurals: new Map() };
46
+ try {
47
+ const ast = new IntlMessageFormat(message, intlTag, undefined, {
48
+ ignoreTag: true,
49
+ }).getAst();
50
+ walk(ast, shape);
51
+ }
52
+ catch (error) {
53
+ return { ok: false, reason: error instanceof Error ? error.message : String(error) };
54
+ }
55
+ return { ok: true, shape };
56
+ }
57
+ /**
58
+ * The parser rejects some things before the shape checks below can run — most
59
+ * importantly a plural or select with no `other` branch, which it reports as
60
+ * `MISSING_OTHER_CLAUSE`. Translating its machine reason into an admin-facing
61
+ * sentence matters: "this is not valid ICU" tells someone editing German copy
62
+ * nothing about which branch they forgot.
63
+ */
64
+ function explainParseFailure(reason) {
65
+ if (reason.includes('MISSING_OTHER_CLAUSE')) {
66
+ return {
67
+ code: 'PLURAL_MISSING_OTHER',
68
+ message: 'Every plural and select needs an "other" branch — it is the fallback used when no other case matches.',
69
+ };
70
+ }
71
+ if (reason.includes('CLOSING_BRACE') || reason.includes('EXPECT_ARGUMENT')) {
72
+ return {
73
+ code: 'ICU_SYNTAX',
74
+ message: 'Unbalanced braces — every { needs a matching }.',
75
+ };
76
+ }
77
+ return {
78
+ code: 'ICU_SYNTAX',
79
+ message: `This is not valid ICU MessageFormat (${reason}).`,
80
+ };
81
+ }
82
+ const ARG_TYPE_NAMES = {
83
+ 1: 'plain',
84
+ 2: 'number',
85
+ 3: 'date',
86
+ 4: 'time',
87
+ 5: 'select',
88
+ 6: 'plural',
89
+ };
90
+ function typeName(type) {
91
+ return type === undefined ? 'absent' : (ARG_TYPE_NAMES[type] ?? `type ${String(type)}`);
92
+ }
93
+ /**
94
+ * Validate one admin-authored override against its en-US source.
95
+ * Collects every failure rather than stopping at the first, so the editor can
96
+ * show an admin all of what is wrong in one pass.
97
+ */
98
+ export function validateMessage(opts) {
99
+ const { candidate, source, locale } = opts;
100
+ const errors = [];
101
+ // An empty override is the third state, not a malformed message.
102
+ if (candidate === '') {
103
+ return opts.allowEmpty === true
104
+ ? { ok: true }
105
+ : { ok: false, errors: [{ code: 'ICU_SYNTAX', message: 'This message may not be blank.' }] };
106
+ }
107
+ const intlTag = intlTagForLocale(locale);
108
+ const parsed = shapeOf(candidate, intlTag);
109
+ if (!parsed.ok)
110
+ return { ok: false, errors: [explainParseFailure(parsed.reason)] };
111
+ const candidateShape = parsed.shape;
112
+ // The source is en-US by definition; parse it under en-US so a locale with
113
+ // unusual plural rules cannot make a perfectly good source look invalid.
114
+ const parsedSource = shapeOf(source, 'en-US');
115
+ // A broken SOURCE is a repo bug, not an admin's fault — accept the override
116
+ // rather than blocking an admin on something they cannot fix.
117
+ if (!parsedSource.ok)
118
+ return { ok: true };
119
+ const sourceShape = parsedSource.shape;
120
+ const sourceArgs = [...sourceShape.args.keys()].sort();
121
+ const candidateArgs = [...candidateShape.args.keys()].sort();
122
+ const missing = sourceArgs.filter((a) => !candidateShape.args.has(a));
123
+ const extra = candidateArgs.filter((a) => !sourceShape.args.has(a));
124
+ if (missing.length > 0 || extra.length > 0) {
125
+ const parts = [];
126
+ if (missing.length > 0)
127
+ parts.push(`missing {${missing.join('}, {')}}`);
128
+ if (extra.length > 0)
129
+ parts.push(`unexpected {${extra.join('}, {')}}`);
130
+ errors.push({
131
+ code: 'ARG_MISMATCH',
132
+ message: `Placeholders must match the English source exactly — ${parts.join('; ')}.`,
133
+ });
134
+ }
135
+ // Argument TYPE parity — the literal-token guard (see the file header).
136
+ for (const [name, sourceType] of sourceShape.args) {
137
+ const candidateType = candidateShape.args.get(name);
138
+ if (candidateType !== undefined && candidateType !== sourceType) {
139
+ errors.push({
140
+ code: 'ARG_TYPE_MISMATCH',
141
+ message: `{${name}} must stay a ${typeName(sourceType)} placeholder — it was changed to ${typeName(candidateType)}.`,
142
+ });
143
+ }
144
+ }
145
+ // Plural parity is BIDIRECTIONAL, matching the compiled parity gate: an
146
+ // override may neither drop a plural the source has nor invent one it does
147
+ // not, because the call site's arguments are fixed by the source.
148
+ const sourcePlurals = [...sourceShape.plurals.keys()].sort();
149
+ const candidatePlurals = [...candidateShape.plurals.keys()].sort();
150
+ if (sourcePlurals.join(',') !== candidatePlurals.join(',')) {
151
+ errors.push({
152
+ code: 'PLURAL_MISMATCH',
153
+ message: sourcePlurals.length === 0
154
+ ? `The English source has no plural, so this override may not add one (${candidatePlurals.join(', ')}).`
155
+ : `Plural placeholders must match the English source exactly (expected ${sourcePlurals.join(', ') || 'none'}).`,
156
+ });
157
+ }
158
+ // Every selector must be a category this locale actually has, and `other`
159
+ // is mandatory — it is the branch ICU falls back to.
160
+ const categories = new Set(pluralCategoriesForLocale(locale));
161
+ for (const [name, selectors] of candidateShape.plurals) {
162
+ const unknown = selectors.filter((s) => !categories.has(s) && !s.startsWith('=') && s !== 'other');
163
+ if (unknown.length > 0) {
164
+ errors.push({
165
+ code: 'PLURAL_CATEGORY',
166
+ message: `{${name}} uses plural categories this language does not have: ${unknown.join(', ')}. Available: ${[...categories].join(', ')}.`,
167
+ });
168
+ }
169
+ if (!selectors.includes('other')) {
170
+ errors.push({
171
+ code: 'PLURAL_MISSING_OTHER',
172
+ message: `{${name}} must include an "other" branch — it is the fallback every language needs.`,
173
+ });
174
+ }
175
+ }
176
+ return errors.length === 0 ? { ok: true } : { ok: false, errors };
177
+ }
178
+ //# sourceMappingURL=validate-message.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate-message.js","sourceRoot":"","sources":["../src/validate-message.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,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