@juicesharp/rpiv-i18n 1.1.3 → 1.1.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/README.md +78 -52
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -15,15 +15,15 @@ i18n/localization SDK for Pi extensions. Pick a UI language interactively or via
|
|
|
15
15
|
|
|
16
16
|
## Features
|
|
17
17
|
|
|
18
|
-
- **One shared locale dial** for every Pi extension that adopts the SDK
|
|
18
|
+
- **One shared locale dial** for every Pi extension that adopts the SDK - `/languages` switches them all at once.
|
|
19
19
|
- **`/languages` slash command** with an interactive picker; persists the choice to `~/.config/rpiv-i18n/locale.json` (chmod `0600`) and reports a clear error if disk persistence fails.
|
|
20
20
|
- **`--locale <code>` CLI flag** for one-shot or scripted launches.
|
|
21
21
|
- **Auto-detects** `process.env.LANG` / `LC_ALL` so most Unix users get a localized UI without configuration.
|
|
22
|
-
- **Tiny SDK surface for authors**
|
|
23
|
-
- **Ships picker entries for** German, English, Spanish, French, Portuguese (European), Portuguese (Brazilian), Russian, and Ukrainian
|
|
24
|
-
- **Live propagation**
|
|
25
|
-
- **Always-safe fallback**
|
|
26
|
-
- **Zero-import escape hatch**
|
|
22
|
+
- **Tiny SDK surface for authors** - `registerStrings(namespace, byLocale)`, `scope(namespace)`, `tr(namespace, key, fallback)`. Render-time lookups, English fallback per missing key, no module-init baking.
|
|
23
|
+
- **Ships picker entries for** German, English, Spanish, French, Portuguese (European), Portuguese (Brazilian), Russian, and Ukrainian - alphabetical by locale code (consumers contribute their own translation maps; the SDK ships infrastructure, not strings).
|
|
24
|
+
- **Live propagation** - locale changes via `/languages` apply to the next render with no restart, even when the SDK is loaded as multiple module instances.
|
|
25
|
+
- **Always-safe fallback** - if the SDK isn't installed at all, every `tr(...)` call returns the consumer's literal English fallback. Extensions stay usable.
|
|
26
|
+
- **Zero-import escape hatch** - `globalThis[Symbol.for("rpiv-i18n")]` exposes a frozen `{ locale, namespaces }` snapshot for tools that prefer not to depend on this package.
|
|
27
27
|
|
|
28
28
|
## For users
|
|
29
29
|
|
|
@@ -33,7 +33,7 @@ Install the SDK so its `/languages` command and `--locale` flag are wired into y
|
|
|
33
33
|
pi install npm:@juicesharp/rpiv-i18n
|
|
34
34
|
```
|
|
35
35
|
|
|
36
|
-
Then restart Pi. (If you installed via `pi install npm:@juicesharp/rpiv-pi` + `/rpiv-setup`, this is already done
|
|
36
|
+
Then restart Pi. (If you installed via `pi install npm:@juicesharp/rpiv-pi` + `/rpiv-setup`, this is already done - `/rpiv-setup` auto-wires every sibling.)
|
|
37
37
|
|
|
38
38
|
Choose a language interactively:
|
|
39
39
|
|
|
@@ -53,7 +53,7 @@ Or edit the config file directly:
|
|
|
53
53
|
echo '{"locale":"uk"}' > ~/.config/rpiv-i18n/locale.json
|
|
54
54
|
```
|
|
55
55
|
|
|
56
|
-
Locale detection priority: `--locale` flag → `~/.config/rpiv-i18n/locale.json` → `process.env.LANG` / `LC_ALL` → English default. The auto-detection paths (config file, env vars) work even without this package installed
|
|
56
|
+
Locale detection priority: `--locale` flag → `~/.config/rpiv-i18n/locale.json` → `process.env.LANG` / `LC_ALL` → English default. The auto-detection paths (config file, env vars) work even without this package installed - any extension that `import`s the SDK as a peer dep gets the registered locale at module init. Only the picker (`/languages`) and the flag (`--locale`) require this package to be loaded as a Pi extension.
|
|
57
57
|
|
|
58
58
|
Other Pi extensions that integrate the SDK pick up your choice automatically.
|
|
59
59
|
|
|
@@ -104,13 +104,13 @@ export default function (pi: ExtensionAPI) {
|
|
|
104
104
|
### Behavior contract
|
|
105
105
|
|
|
106
106
|
- **English fallback per key.** If a key exists in `en` but not in the active locale's map, the English entry is returned. Missing-only-in-current-locale strings stay readable.
|
|
107
|
-
- **Always-safe fallback.** If neither this SDK nor your namespace is loaded, every `tr(...)` call returns its `fallback` literal
|
|
107
|
+
- **Always-safe fallback.** If neither this SDK nor your namespace is loaded, every `tr(...)` call returns its `fallback` literal - your extension keeps working.
|
|
108
108
|
- **Live locale changes.** When the user runs `/languages`, the next `tr(...)` call returns the new locale's string. No restart required.
|
|
109
|
-
- **Render-time only.** Call `tr(...)` at render time
|
|
109
|
+
- **Render-time only.** Call `tr(...)` at render time - never bake the result into a top-level `const X = tr(...)`. Module-init evaluation freezes the string before the user has a chance to set their locale.
|
|
110
110
|
|
|
111
|
-
## Localizing your extension
|
|
111
|
+
## Localizing your extension - step by step
|
|
112
112
|
|
|
113
|
-
The inline example above is fine for a one-key smoke test. For a real Pi extension, use the file-based pattern that scales to dozens of strings and ten contributors.
|
|
113
|
+
The inline example above is fine for a one-key smoke test. For a real Pi extension, use the file-based pattern that scales to dozens of strings and ten contributors. Two production exemplars in this monorepo follow this exact shape: `packages/rpiv-ask-user-question/` (questionnaire UI; bridge owns `t` + `displayLabel(kind)` for sentinel rows) and `packages/rpiv-todo/` (todo overlay + `/todos` command; bridge owns `t` + `formatStatusLabel(status)` reused across overlay and command). Read either alongside this guide.
|
|
114
114
|
|
|
115
115
|
End state on disk:
|
|
116
116
|
|
|
@@ -126,18 +126,23 @@ my-extension/
|
|
|
126
126
|
└── package.json ← peerDependencies + files[] + pi.extensions
|
|
127
127
|
```
|
|
128
128
|
|
|
129
|
-
### 0. Declare the SDK as
|
|
129
|
+
### 0. Declare the SDK as an OPTIONAL peer dependency
|
|
130
130
|
|
|
131
131
|
```json
|
|
132
132
|
{
|
|
133
133
|
"peerDependencies": {
|
|
134
134
|
"@juicesharp/rpiv-i18n": "*",
|
|
135
135
|
"@mariozechner/pi-coding-agent": "*"
|
|
136
|
+
},
|
|
137
|
+
"peerDependenciesMeta": {
|
|
138
|
+
"@juicesharp/rpiv-i18n": { "optional": true }
|
|
136
139
|
}
|
|
137
140
|
}
|
|
138
141
|
```
|
|
139
142
|
|
|
140
|
-
Use `peerDependencies`, not `dependencies`
|
|
143
|
+
Use `peerDependencies`, not `dependencies` - the user's Pi session loads one copy of the SDK; if you bundle your own, `/languages` toggles a different runtime instance and your strings never switch.
|
|
144
|
+
|
|
145
|
+
Mark it `optional: true` in `peerDependenciesMeta` so npm doesn't warn when a user installs your extension standalone without rpiv-i18n. Pair this with the dynamic-import shim shown in step 3 - your extension stays online with English-only UI when the SDK isn't installed, and lights up localization automatically when it is.
|
|
141
146
|
|
|
142
147
|
### 1. Author a `locales/en.json` next to your source
|
|
143
148
|
|
|
@@ -151,33 +156,49 @@ Use `peerDependencies`, not `dependencies` — the user's Pi session loads one c
|
|
|
151
156
|
}
|
|
152
157
|
```
|
|
153
158
|
|
|
154
|
-
Conventions: flat dotted lowercase keys, `snake_case` only for multi-word leaves (`hint.cancel` ✓, `hint.cancelKey` ✗). `_meta.*` keys are ignored at lookup time
|
|
159
|
+
Conventions: flat dotted lowercase keys, `snake_case` only for multi-word leaves (`hint.cancel` ✓, `hint.cancelKey` ✗). `_meta.*` keys are ignored at lookup time - use them for provenance / WIP notes.
|
|
155
160
|
|
|
156
161
|
### 2. Add a one-file bridge inside your package
|
|
157
162
|
|
|
158
|
-
`state/i18n-bridge.ts` (or wherever your package keeps cross-cutting helpers):
|
|
163
|
+
`state/i18n-bridge.ts` (or wherever your package keeps cross-cutting helpers). Use a dynamic-import shim with top-level `await` so a missing peer degrades to English-only instead of failing module load:
|
|
159
164
|
|
|
160
165
|
```ts
|
|
161
|
-
import { scope } from "@juicesharp/rpiv-i18n";
|
|
162
|
-
|
|
163
166
|
export const I18N_NAMESPACE = "@my-org/cool-tool";
|
|
164
167
|
|
|
165
|
-
|
|
168
|
+
type ScopeFn = (key: string, fallback: string) => string;
|
|
169
|
+
type I18nSDK = { scope: (namespace: string) => ScopeFn };
|
|
170
|
+
|
|
171
|
+
let scopeImpl: ScopeFn;
|
|
172
|
+
try {
|
|
173
|
+
const sdk = (await import("@juicesharp/rpiv-i18n")) as I18nSDK;
|
|
174
|
+
scopeImpl = sdk.scope(I18N_NAMESPACE);
|
|
175
|
+
} catch {
|
|
176
|
+
// SDK not installed - every t(key, fallback) returns the fallback verbatim.
|
|
177
|
+
scopeImpl = (_key, fallback) => fallback;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
export const t: ScopeFn = scopeImpl;
|
|
166
181
|
```
|
|
167
182
|
|
|
168
183
|
Every render-time call site imports `t` from this one file. If you ever switch namespaces, change the SDK, or add a `displayLabel(kind)` convenience for sentinel-row enums, you touch one place.
|
|
169
184
|
|
|
185
|
+
**Why dynamic import instead of static `import { scope } from "@juicesharp/rpiv-i18n"`?** A static ESM import is hoisted and evaluated at module load - if the SDK isn't on disk, your entire extension fails to load with `Cannot find module '@juicesharp/rpiv-i18n'`. The dynamic `await import()` inside a try/catch lets module load proceed, and the identity-fallback closure keeps your render call sites working with English. Top-level await is required because the `t` export is consumed synchronously by every render call site downstream.
|
|
186
|
+
|
|
170
187
|
### 3. Register strings at extension load
|
|
171
188
|
|
|
189
|
+
Use the same dynamic-import shim pattern as the bridge - `registerStrings` is a runtime call, so it goes inside a try/catch that no-ops when the SDK is missing:
|
|
190
|
+
|
|
172
191
|
```ts
|
|
173
192
|
import { readFileSync } from "node:fs";
|
|
174
193
|
import { fileURLToPath } from "node:url";
|
|
175
194
|
import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
|
|
176
|
-
import { registerStrings, type TranslationMap } from "@juicesharp/rpiv-i18n";
|
|
177
195
|
import { I18N_NAMESPACE } from "./state/i18n-bridge.js";
|
|
178
196
|
|
|
197
|
+
type TranslationMap = Readonly<Record<string, string>>;
|
|
198
|
+
type I18nSDK = { registerStrings: (ns: string, byLocale: Record<string, TranslationMap>) => void };
|
|
199
|
+
|
|
179
200
|
function loadLocale(code: string): TranslationMap {
|
|
180
|
-
// A missing/malformed locale file MUST NOT crash module init
|
|
201
|
+
// A missing/malformed locale file MUST NOT crash module init - the bridge's
|
|
181
202
|
// literal English fallbacks will keep every render readable.
|
|
182
203
|
try {
|
|
183
204
|
return JSON.parse(
|
|
@@ -189,34 +210,39 @@ function loadLocale(code: string): TranslationMap {
|
|
|
189
210
|
}
|
|
190
211
|
}
|
|
191
212
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
213
|
+
try {
|
|
214
|
+
const sdk = (await import("@juicesharp/rpiv-i18n")) as I18nSDK;
|
|
215
|
+
sdk.registerStrings(I18N_NAMESPACE, {
|
|
216
|
+
en: loadLocale("en"),
|
|
217
|
+
// Add more as files arrive. Order doesn't matter; keys missing from a
|
|
218
|
+
// non-en map fall back to en automatically.
|
|
219
|
+
});
|
|
220
|
+
} catch {
|
|
221
|
+
// SDK absent - extension still loads with English-only UI.
|
|
222
|
+
}
|
|
197
223
|
|
|
198
224
|
export default function (pi: ExtensionAPI): void {
|
|
199
225
|
// your tool/command/hook registrations here…
|
|
200
226
|
}
|
|
201
227
|
```
|
|
202
228
|
|
|
203
|
-
`registerStrings` runs at module top-level, before Pi calls your default export. That timing is intentional
|
|
229
|
+
`registerStrings` runs at module top-level, before Pi calls your default export. That timing is intentional - by the time the first `tr(...)` fires, every locale map is in the registry.
|
|
204
230
|
|
|
205
231
|
### 4. Use `t(key, fallback)` at the render call site
|
|
206
232
|
|
|
207
233
|
```ts
|
|
208
234
|
import { t } from "../state/i18n-bridge.js";
|
|
209
235
|
|
|
210
|
-
// ✓ Render-time
|
|
236
|
+
// ✓ Render-time - re-evaluated each render; live `/languages` switches apply
|
|
211
237
|
function renderHeader(theme) {
|
|
212
238
|
return new Text(theme.bold(t("welcome.title", "Welcome")));
|
|
213
239
|
}
|
|
214
240
|
|
|
215
|
-
// ✗ Module-init
|
|
241
|
+
// ✗ Module-init - captured ONCE, freezes English on first load
|
|
216
242
|
const HEADING = t("welcome.title", "Welcome");
|
|
217
243
|
```
|
|
218
244
|
|
|
219
|
-
The fallback string is the canonical English literal
|
|
245
|
+
The fallback string is the canonical English literal - same one you put in `en.json`. Keep it inline at the call site so the file reads end-to-end without locale lookups, and so your extension stays usable when the SDK isn't installed at all.
|
|
220
246
|
|
|
221
247
|
### 5. Ship the locale files in `package.json`
|
|
222
248
|
|
|
@@ -235,9 +261,9 @@ The `files[]` manifest is the #1 publish-time miss in this monorepo's history. S
|
|
|
235
261
|
|
|
236
262
|
### What stays English (do NOT route through `t(...)`)
|
|
237
263
|
|
|
238
|
-
- Tool descriptions, TypeBox `description` fields, prompt guidelines / snippets
|
|
239
|
-
- Validation errors that flow back through `tool result` envelopes
|
|
240
|
-
- Anything checked by exact-string matching (reserved labels, dispatcher discriminants)
|
|
264
|
+
- Tool descriptions, TypeBox `description` fields, prompt guidelines / snippets - these go to the LLM. Localizing them risks the model emitting localized option labels that bypass your `RESERVED_LABEL_SET` validation.
|
|
265
|
+
- Validation errors that flow back through `tool result` envelopes - same reason.
|
|
266
|
+
- Anything checked by exact-string matching (reserved labels, dispatcher discriminants) - keep both sides in canonical English.
|
|
241
267
|
|
|
242
268
|
The recommended pattern is to keep a top-level `const X = "literal"` for the canonical English (so reserved-label checks and tests stay stable), then route the **render call site** through `t("key", X)`. The SDK never sees `X`; the LLM never sees `t(...)`.
|
|
243
269
|
|
|
@@ -254,7 +280,7 @@ export function displayLabel(kind: SentinelKind): string {
|
|
|
254
280
|
}
|
|
255
281
|
```
|
|
256
282
|
|
|
257
|
-
Render code becomes `displayLabel("next")` instead of `t("sentinel.next", "Next")`
|
|
283
|
+
Render code becomes `displayLabel("next")` instead of `t("sentinel.next", "Next")` - same lookup, but the canonical English fallback is sourced from the same metadata table the rest of your code uses. One source of truth per kind.
|
|
258
284
|
|
|
259
285
|
### Optional: a non-English locale file
|
|
260
286
|
|
|
@@ -266,7 +292,7 @@ Add `locales/uk.json` mirroring the en key set:
|
|
|
266
292
|
|
|
267
293
|
"welcome.title": "Ласкаво просимо",
|
|
268
294
|
"submit.button": "Надіслати",
|
|
269
|
-
"hint.cancel": "Esc
|
|
295
|
+
"hint.cancel": "Esc - скасувати"
|
|
270
296
|
}
|
|
271
297
|
```
|
|
272
298
|
|
|
@@ -276,7 +302,7 @@ Done. `/languages` now switches your extension's UI alongside every other extens
|
|
|
276
302
|
|
|
277
303
|
### Verify it works locally before publishing
|
|
278
304
|
|
|
279
|
-
The SDK only flips strings when it's loaded by a real Pi session
|
|
305
|
+
The SDK only flips strings when it's loaded by a real Pi session - `npm test` won't catch a missing `files[]` entry or a wrong namespace. Smoke-test against a live `pi` shell:
|
|
280
306
|
|
|
281
307
|
```bash
|
|
282
308
|
# from your extension's directory
|
|
@@ -289,21 +315,21 @@ pi # launch the session
|
|
|
289
315
|
```
|
|
290
316
|
|
|
291
317
|
Two failure modes this catches that unit tests do not:
|
|
292
|
-
1. **Locale JSON not shipped**
|
|
293
|
-
2. **Module-init `tr(...)` capture**
|
|
318
|
+
1. **Locale JSON not shipped** - `/languages` switches but your strings stay English. Fix: add `"locales/"` to `package.json` `files[]`.
|
|
319
|
+
2. **Module-init `tr(...)` capture** - picker switches, other extensions flip, yours doesn't. Fix: move the `t(...)` call inside the render function.
|
|
294
320
|
|
|
295
321
|
## Contributing translations
|
|
296
322
|
|
|
297
|
-
Want to add or improve a translation for a Pi extension that uses this SDK? Open a PR
|
|
323
|
+
Want to add or improve a translation for a Pi extension that uses this SDK? Open a PR - the contract is small and uniform across packages.
|
|
298
324
|
|
|
299
325
|
### What to translate (and what NOT to)
|
|
300
326
|
|
|
301
|
-
**Translate**: every key listed in the package's `locales/en.json`. These are TUI-facing strings
|
|
327
|
+
**Translate**: every key listed in the package's `locales/en.json`. These are TUI-facing strings - labels, hints, prompts, headings - read by humans on screen.
|
|
302
328
|
|
|
303
329
|
**Do NOT translate**:
|
|
304
|
-
- Tool descriptions, TypeBox `description` fields, prompt guidelines, prompt snippets
|
|
305
|
-
- Validation errors that flow through `tool result` envelopes (e.g. `"Error: UI not available …"`)
|
|
306
|
-
- `RESERVED_LABELS` and any keys checked by reserved-label validation
|
|
330
|
+
- Tool descriptions, TypeBox `description` fields, prompt guidelines, prompt snippets - they go to the LLM and stay English so the model parses them deterministically across sessions and providers.
|
|
331
|
+
- Validation errors that flow through `tool result` envelopes (e.g. `"Error: UI not available …"`) - same reason.
|
|
332
|
+
- `RESERVED_LABELS` and any keys checked by reserved-label validation - translating these lets a localized equivalent slip past the duplicate-detection guard.
|
|
307
333
|
|
|
308
334
|
If a key isn't in the package's `locales/en.json`, it's intentionally English-only. Don't invent new keys; open an issue first if you think a string should be made localizable.
|
|
309
335
|
|
|
@@ -311,7 +337,7 @@ If a key isn't in the package's `locales/en.json`, it's intentionally English-on
|
|
|
311
337
|
|
|
312
338
|
- One JSON file per locale, named `<code>.json` (e.g. `es.json`, `fr.json`, `pt-BR.json`), inside the consumer package's `locales/` directory.
|
|
313
339
|
- Locale codes follow BCP-47-ish convention: language only (`es`, `fr`, `de`) or `language-Region` for variants (`pt-BR`, `zh-CN`). Keep hyphenated, not underscored.
|
|
314
|
-
- Mirror the exact key set from `en.json`. Missing keys fall back to English silently
|
|
340
|
+
- Mirror the exact key set from `en.json`. Missing keys fall back to English silently - that's fine, but the `_meta.notes` field below should mention the gap.
|
|
315
341
|
|
|
316
342
|
### Key naming convention
|
|
317
343
|
|
|
@@ -321,19 +347,19 @@ Flat dotted lowercase: `sentinel.next`, `submit.cancel`, `preview.no_preview`. U
|
|
|
321
347
|
|
|
322
348
|
```json
|
|
323
349
|
{
|
|
324
|
-
"_meta.notes": "Optional contributor note
|
|
350
|
+
"_meta.notes": "Optional contributor note - auto-translated, native review welcome, key gaps, etc.",
|
|
325
351
|
|
|
326
352
|
"<dotted.key.from.en.json>": "Localized string"
|
|
327
353
|
}
|
|
328
354
|
```
|
|
329
355
|
|
|
330
|
-
`_meta.*` keys are ignored by `tr(...)` lookups (no consumer requests them). Use them for provenance, change notes, or "WIP
|
|
356
|
+
`_meta.*` keys are ignored by `tr(...)` lookups (no consumer requests them). Use them for provenance, change notes, or "WIP - N keys missing".
|
|
331
357
|
|
|
332
358
|
### Universal CLI conventions (do NOT translate)
|
|
333
359
|
|
|
334
|
-
- Symbols: `↑/↓`, `⚠`, `✓`
|
|
335
|
-
- Keyboard names: `Enter`, `Esc`, `Tab`, `Space`
|
|
336
|
-
- Single-key shortcut letters (`n` to add notes): keep the letter unchanged
|
|
360
|
+
- Symbols: `↑/↓`, `⚠`, `✓` - render the same in every locale.
|
|
361
|
+
- Keyboard names: `Enter`, `Esc`, `Tab`, `Space` - these are the labels printed on physical keyboards worldwide. Some locales (e.g. French) write `Entrée` / `Échap`; that's acceptable when paired with the convention you're targeting (KDE/GNOME do this), but be consistent across the file.
|
|
362
|
+
- Single-key shortcut letters (`n` to add notes): keep the letter unchanged - it maps to a literal keystroke handler, not to a label.
|
|
337
363
|
|
|
338
364
|
### Registering the locale
|
|
339
365
|
|
|
@@ -362,7 +388,7 @@ Include:
|
|
|
362
388
|
1. The new `locales/<code>.json` file.
|
|
363
389
|
2. The `registerStrings(...)` update in the consumer's entry point.
|
|
364
390
|
3. The `SUPPORTED_LOCALES` entry in `rpiv-i18n/i18n.ts`.
|
|
365
|
-
4. Run `npm run check && npm test` from the monorepo root
|
|
391
|
+
4. Run `npm run check && npm test` from the monorepo root - both must pass.
|
|
366
392
|
|
|
367
393
|
A native-speaker reviewer will land it. Auto-translated drafts are accepted (mark them in `_meta.notes`); English fallbacks make any gap or error invisible to users until a fix arrives.
|
|
368
394
|
|
|
@@ -374,7 +400,7 @@ For tools that prefer not to import this package, the active state is also publi
|
|
|
374
400
|
const I18N = Symbol.for("rpiv-i18n");
|
|
375
401
|
|
|
376
402
|
function lookup(key: string, fallback: string): string {
|
|
377
|
-
// Re-read the symbol on every call
|
|
403
|
+
// Re-read the symbol on every call - the SDK *replaces* the snapshot
|
|
378
404
|
// (frozen object) on every registerStrings/applyLocale, so a cached
|
|
379
405
|
// reference will silently serve stale strings after `/languages`.
|
|
380
406
|
const state = (globalThis as { [k: symbol]: unknown })[I18N] as
|
|
@@ -386,4 +412,4 @@ function lookup(key: string, fallback: string): string {
|
|
|
386
412
|
lookup("welcome", "Welcome!");
|
|
387
413
|
```
|
|
388
414
|
|
|
389
|
-
The published object is frozen *per snapshot*, so each new locale produces a new frozen object
|
|
415
|
+
The published object is frozen *per snapshot*, so each new locale produces a new frozen object - read the symbol at call time, never hoist it into a module-scope `const`. Registration MUST still go through `registerStrings(...)`; writing into `globalThis[I18N]` directly is unsupported.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@juicesharp/rpiv-i18n",
|
|
3
|
-
"version": "1.1.
|
|
4
|
-
"description": "Pi extension
|
|
3
|
+
"version": "1.1.5",
|
|
4
|
+
"description": "Pi extension. The localization foundation for rpiv-* skills: locale detection, the /languages command, the --locale flag, and a cross-package locale registry.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi-package",
|
|
7
7
|
"pi-extension",
|