@juicesharp/rpiv-i18n 1.1.0 → 1.1.2
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 +21 -2
- package/docs/cover.png +0 -0
- package/docs/cover.svg +119 -0
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @juicesharp/rpiv-i18n
|
|
2
2
|
|
|
3
|
+
<div align="center">
|
|
4
|
+
<a href="https://github.com/juicesharp/rpiv-mono/tree/main/packages/rpiv-i18n">
|
|
5
|
+
<picture>
|
|
6
|
+
<img src="https://raw.githubusercontent.com/juicesharp/rpiv-mono/main/packages/rpiv-i18n/docs/cover.png" alt="rpiv-i18n cover" width="50%">
|
|
7
|
+
</picture>
|
|
8
|
+
</a>
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
[](https://www.npmjs.com/package/@juicesharp/rpiv-i18n)
|
|
12
|
+
[](https://opensource.org/licenses/MIT)
|
|
13
|
+
|
|
3
14
|
i18n/localization SDK for Pi extensions. Pick a UI language interactively or via flag; localize your own Pi extension with a few lines of code.
|
|
4
15
|
|
|
5
16
|
## Features
|
|
@@ -16,7 +27,15 @@ i18n/localization SDK for Pi extensions. Pick a UI language interactively or via
|
|
|
16
27
|
|
|
17
28
|
## For users
|
|
18
29
|
|
|
19
|
-
Install the
|
|
30
|
+
Install the SDK so its `/languages` command and `--locale` flag are wired into your Pi session:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
pi install npm:@juicesharp/rpiv-i18n
|
|
34
|
+
```
|
|
35
|
+
|
|
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
|
+
|
|
38
|
+
Choose a language interactively:
|
|
20
39
|
|
|
21
40
|
```
|
|
22
41
|
/languages
|
|
@@ -34,7 +53,7 @@ Or edit the config file directly:
|
|
|
34
53
|
echo '{"locale":"uk"}' > ~/.config/rpiv-i18n/locale.json
|
|
35
54
|
```
|
|
36
55
|
|
|
37
|
-
Locale detection priority: `--locale` flag → `~/.config/rpiv-i18n/locale.json` → `process.env.LANG` / `LC_ALL` → English default.
|
|
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.
|
|
38
57
|
|
|
39
58
|
Other Pi extensions that integrate the SDK pick up your choice automatically.
|
|
40
59
|
|
package/docs/cover.png
ADDED
|
Binary file
|
package/docs/cover.svg
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1280 800" role="img" aria-label="rpiv-i18n — i18n for any Pi extension in 3 lines" preserveAspectRatio="xMidYMid meet">
|
|
2
|
+
<title>rpiv-i18n — i18n for any Pi extension in 3 lines</title>
|
|
3
|
+
<defs>
|
|
4
|
+
<style>
|
|
5
|
+
.mono { font-family: 'JetBrains Mono', 'Fira Code', 'SFMono-Regular', ui-monospace, Menlo, Consolas, monospace; }
|
|
6
|
+
.display { font-family: ui-sans-serif, system-ui, -apple-system, 'SF Pro Display', 'Helvetica Neue', 'Inter', sans-serif; }
|
|
7
|
+
.ink { fill: #F4EFE6; }
|
|
8
|
+
.paper { fill: #0E0D0B; }
|
|
9
|
+
.muted { fill: #7A7468; }
|
|
10
|
+
.dim { fill: #4A463F; }
|
|
11
|
+
.accent { fill: #FF7A3D; }
|
|
12
|
+
.mint { fill: #6FD0B8; }
|
|
13
|
+
.rule { stroke: #2A2620; }
|
|
14
|
+
.rule-bright { stroke: #FF7A3D; }
|
|
15
|
+
</style>
|
|
16
|
+
<filter id="grain" x="0" y="0" width="100%" height="100%">
|
|
17
|
+
<feTurbulence type="fractalNoise" baseFrequency="1.4" numOctaves="2" seed="33"/>
|
|
18
|
+
<feColorMatrix values="0 0 0 0 0.96
|
|
19
|
+
0 0 0 0 0.94
|
|
20
|
+
0 0 0 0 0.88
|
|
21
|
+
0 0 0 0.06 0"/>
|
|
22
|
+
</filter>
|
|
23
|
+
<pattern id="grid" width="32" height="32" patternUnits="userSpaceOnUse">
|
|
24
|
+
<path d="M32 0 H0 V32" fill="none" stroke="#161411" stroke-width="0.5"/>
|
|
25
|
+
</pattern>
|
|
26
|
+
<pattern id="dots" width="6" height="6" patternUnits="userSpaceOnUse">
|
|
27
|
+
<circle cx="3" cy="3" r="0.6" fill="#231F1A"/>
|
|
28
|
+
</pattern>
|
|
29
|
+
<radialGradient id="vignette" cx="50%" cy="50%" r="70%">
|
|
30
|
+
<stop offset="60%" stop-color="#0E0D0B" stop-opacity="0"/>
|
|
31
|
+
<stop offset="100%" stop-color="#000" stop-opacity="0.55"/>
|
|
32
|
+
</radialGradient>
|
|
33
|
+
</defs>
|
|
34
|
+
|
|
35
|
+
<!-- Canvas -->
|
|
36
|
+
<rect width="1280" height="800" class="paper"/>
|
|
37
|
+
<rect width="1280" height="800" fill="url(#grid)" opacity="0.55"/>
|
|
38
|
+
<rect width="1280" height="800" fill="url(#dots)" opacity="0.4"/>
|
|
39
|
+
<rect width="1280" height="800" filter="url(#grain)" opacity="0.5"/>
|
|
40
|
+
<rect width="1280" height="800" fill="url(#vignette)"/>
|
|
41
|
+
|
|
42
|
+
<!-- Crop marks -->
|
|
43
|
+
<g class="rule-bright" stroke-width="1" fill="none" opacity="0.95">
|
|
44
|
+
<path d="M40 56 L56 56 M56 40 L56 56"/>
|
|
45
|
+
<path d="M1240 56 L1224 56 M1224 40 L1224 56"/>
|
|
46
|
+
<path d="M40 744 L56 744 M56 760 L56 744"/>
|
|
47
|
+
<path d="M1240 744 L1224 744 M1224 760 L1224 744"/>
|
|
48
|
+
</g>
|
|
49
|
+
|
|
50
|
+
<!-- Top spec strip -->
|
|
51
|
+
<line x1="64" y1="56" x2="1216" y2="56" class="rule" stroke-width="1"/>
|
|
52
|
+
<text class="mono muted" x="64" y="44" font-size="10.5" letter-spacing="2.4">@JUICESHARP · PI AGENT EXTENSION · NO. 009 – I18N</text>
|
|
53
|
+
<text class="mono muted" x="1216" y="44" font-size="10.5" letter-spacing="2.4" text-anchor="end">MIT · v0.1 · 1280 × 800</text>
|
|
54
|
+
|
|
55
|
+
<!-- Logotype -->
|
|
56
|
+
<text class="display ink" x="64" y="200" font-size="116" font-weight="700" letter-spacing="-4">r<tspan fill="#6FD0B8">pi</tspan>v<tspan class="accent">-</tspan>i18n</text>
|
|
57
|
+
<line x1="64" y1="216" x2="178" y2="216" class="rule-bright" stroke-width="2"/>
|
|
58
|
+
<text class="mono muted" x="64" y="246" font-size="16" letter-spacing="0.5">i18n for any Pi extension — in 3 lines.</text>
|
|
59
|
+
<text class="mono dim" x="64" y="270" font-size="11" letter-spacing="2.2">/LANGUAGES PICKER · --LOCALE FLAG · ENGLISH FALLBACK PER KEY</text>
|
|
60
|
+
|
|
61
|
+
<!-- Locale chips top-right -->
|
|
62
|
+
<g transform="translate(1080 188)">
|
|
63
|
+
<rect x="0" y="-22" width="60" height="36" fill="#13110D" stroke="#6FD0B8" stroke-width="1.5"/>
|
|
64
|
+
<text class="mono mint" x="30" y="2" font-size="18" font-weight="700" letter-spacing="1.5" text-anchor="middle">EN</text>
|
|
65
|
+
<rect x="68" y="-22" width="60" height="36" fill="#13110D" stroke="#6FD0B8" stroke-width="1.5"/>
|
|
66
|
+
<text class="mono mint" x="98" y="2" font-size="18" font-weight="700" letter-spacing="1.5" text-anchor="middle">DE</text>
|
|
67
|
+
<text class="mono muted" x="64" y="34" font-size="10" letter-spacing="2" text-anchor="middle">+ ANY OTHER</text>
|
|
68
|
+
</g>
|
|
69
|
+
|
|
70
|
+
<!-- FIG header -->
|
|
71
|
+
<text class="mono muted" x="64" y="328" font-size="10.5" letter-spacing="2.4">FIG. 01 — THREE-LINE API</text>
|
|
72
|
+
<text class="mono muted" x="1216" y="328" font-size="10.5" letter-spacing="2.4" text-anchor="end">register → scope → translate</text>
|
|
73
|
+
<line x1="64" y1="340" x2="1216" y2="340" class="rule" stroke-width="0.75"/>
|
|
74
|
+
|
|
75
|
+
<!-- ===== HERO: 3 code rows ===== -->
|
|
76
|
+
|
|
77
|
+
<!-- Row 1: register -->
|
|
78
|
+
<g transform="translate(64 360)">
|
|
79
|
+
<rect x="0" y="0" width="1152" height="80" fill="#15120E" stroke="#3A3530" stroke-width="1"/>
|
|
80
|
+
<text class="mono dim" x="14" y="22" font-size="11" letter-spacing="1.8">001 — REGISTER STRINGS</text>
|
|
81
|
+
<text class="mono ink" x="14" y="58" font-size="26">
|
|
82
|
+
<tspan class="accent" font-weight="700">registerStrings</tspan>(<tspan class="mint">'@me/tool'</tspan>, { <tspan class="mint">en</tspan>, <tspan class="mint">de</tspan> })
|
|
83
|
+
</text>
|
|
84
|
+
</g>
|
|
85
|
+
|
|
86
|
+
<!-- arrow -->
|
|
87
|
+
<path d="M640 460 L640 510" stroke="#FF7A3D" stroke-width="3" fill="none"/>
|
|
88
|
+
<path d="M624 498 L640 514 L656 498" fill="none" stroke="#FF7A3D" stroke-width="3" stroke-linejoin="round" stroke-linecap="round"/>
|
|
89
|
+
|
|
90
|
+
<!-- Row 2: scope -->
|
|
91
|
+
<g transform="translate(64 524)">
|
|
92
|
+
<rect x="0" y="0" width="1152" height="80" fill="#15120E" stroke="#3A3530" stroke-width="1"/>
|
|
93
|
+
<text class="mono dim" x="14" y="22" font-size="11" letter-spacing="1.8">002 — SCOPE TO YOUR PACKAGE</text>
|
|
94
|
+
<text class="mono ink" x="14" y="58" font-size="26">
|
|
95
|
+
<tspan class="dim">const</tspan> <tspan class="ink" font-weight="700">t</tspan> = <tspan class="accent" font-weight="700">scope</tspan>(<tspan class="mint">'@me/tool'</tspan>)
|
|
96
|
+
</text>
|
|
97
|
+
</g>
|
|
98
|
+
|
|
99
|
+
<!-- arrow -->
|
|
100
|
+
<path d="M640 624 L640 660" stroke="#FF7A3D" stroke-width="3" fill="none"/>
|
|
101
|
+
<path d="M624 648 L640 664 L656 648" fill="none" stroke="#FF7A3D" stroke-width="3" stroke-linejoin="round" stroke-linecap="round"/>
|
|
102
|
+
|
|
103
|
+
<!-- Row 3: translate -->
|
|
104
|
+
<g transform="translate(64 672)">
|
|
105
|
+
<rect x="0" y="0" width="1152" height="32" fill="#13110D" stroke="#1F3A33" stroke-width="1"/>
|
|
106
|
+
<text class="mono ink" x="14" y="22" font-size="20">
|
|
107
|
+
<tspan class="ink" font-weight="700">t</tspan>(<tspan class="mint">'hint.enter'</tspan>, <tspan class="mint">'Enter to select'</tspan>)<tspan class="muted"> → </tspan><tspan class="mint" font-weight="700">"Eingabe zum Auswählen"</tspan>
|
|
108
|
+
</text>
|
|
109
|
+
</g>
|
|
110
|
+
|
|
111
|
+
<!-- Footer -->
|
|
112
|
+
<line x1="64" y1="720" x2="1216" y2="720" class="rule" stroke-width="1"/>
|
|
113
|
+
<text class="mono ink" x="64" y="754" font-size="20" letter-spacing="0.5">
|
|
114
|
+
<tspan class="accent" font-weight="700">▶</tspan> pi install npm:@juicesharp/rpiv-i18n
|
|
115
|
+
</text>
|
|
116
|
+
<text class="mono muted" x="1216" y="754" font-size="14" letter-spacing="2" text-anchor="end" font-weight="700">
|
|
117
|
+
REGISTER · SCOPE · TRANSLATE
|
|
118
|
+
</text>
|
|
119
|
+
</svg>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@juicesharp/rpiv-i18n",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "Pi extension: i18n/localization foundation — locale detection, /languages command, --locale flag, cross-package locale registry",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi-package",
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
"index.ts",
|
|
32
32
|
"i18n.ts",
|
|
33
33
|
"i18n-ui.ts",
|
|
34
|
+
"docs/",
|
|
34
35
|
"README.md",
|
|
35
36
|
"LICENSE"
|
|
36
37
|
],
|