emdash-schema-i18n 1.1.1 → 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 +34 -8
- package/emdash-plugin.jsonc +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
> Dynamic schema, collections, and block types localization for **EmDash CMS** Admin UI.
|
|
4
4
|
|
|
5
|
-
[](https://www.npmjs.com/package/emdash-schema-i18n)
|
|
6
|
+
[](https://www.npmjs.com/package/emdash-schema-i18n)
|
|
7
|
+
[](LICENSE)
|
|
7
8
|
|
|
8
9
|
**Author:** Serhii Parshyn (<serhii@parshyn.com>)
|
|
9
10
|
|
|
@@ -23,7 +24,7 @@ In EmDash CMS, metadata for collections, fields, and block types (`label`, `labe
|
|
|
23
24
|
- **Dictionary phrase lookup:** Easily map English phrases to any target language (`"Case studies": "Кейси"`, `"Chapter": "Розділ"`).
|
|
24
25
|
- **Exact path overrides:** Override specific fields when needed (e.g. `collections.case_study.fields.title.label`).
|
|
25
26
|
- **Comprehensive coverage:** Localizes collections, singular labels, field inputs, dropdown options, and block types with all their nested version fields.
|
|
26
|
-
- **Automatic Scaffolding:**
|
|
27
|
+
- **Automatic Scaffolding:** Scans schemas and block types to scaffold untranslated strings via CLI.
|
|
27
28
|
- **Zero-config slash fallback:** Still supports automatic splitting of legacy bilingual strings (`"Українська / English"`).
|
|
28
29
|
|
|
29
30
|
---
|
|
@@ -40,7 +41,27 @@ In EmDash CMS, metadata for collections, fields, and block types (`label`, `labe
|
|
|
40
41
|
|
|
41
42
|
---
|
|
42
43
|
|
|
43
|
-
## Installation
|
|
44
|
+
## Installation
|
|
45
|
+
|
|
46
|
+
Install the package from npm using your package manager of choice:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
# npm
|
|
50
|
+
npm install emdash-schema-i18n
|
|
51
|
+
|
|
52
|
+
# pnpm
|
|
53
|
+
pnpm add emdash-schema-i18n
|
|
54
|
+
|
|
55
|
+
# yarn
|
|
56
|
+
yarn add emdash-schema-i18n
|
|
57
|
+
|
|
58
|
+
# bun
|
|
59
|
+
bun add emdash-schema-i18n
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## Setup & Configuration
|
|
44
65
|
|
|
45
66
|
### 1. In `astro.config.mjs`
|
|
46
67
|
|
|
@@ -134,15 +155,20 @@ export default adminDictionary;
|
|
|
134
155
|
|
|
135
156
|
---
|
|
136
157
|
|
|
137
|
-
## Scaffolding
|
|
138
|
-
|
|
139
|
-
To extract all schema and block type strings automatically:
|
|
158
|
+
## Scaffolding & CLI
|
|
159
|
+
|
|
160
|
+
To extract all schema and block type strings into a translation dictionary automatically:
|
|
140
161
|
|
|
141
162
|
```bash
|
|
163
|
+
# Run directly via npx
|
|
164
|
+
npx emdash-schema-i18n extract
|
|
165
|
+
|
|
166
|
+
# Or add to your package.json scripts:
|
|
167
|
+
# "i18n:extract": "emdash-schema-i18n extract"
|
|
142
168
|
npm run i18n:extract
|
|
143
169
|
```
|
|
144
170
|
|
|
145
|
-
The
|
|
171
|
+
The CLI scans `seed/seed.json` and block types, preserves all existing translations, and appends any newly created untranslated fields.
|
|
146
172
|
|
|
147
173
|
---
|
|
148
174
|
|
package/emdash-plugin.jsonc
CHANGED