locale-keysmith 0.3.0 → 0.3.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/LICENSE +1 -1
- package/README.md +138 -70
- package/dist/usage.js +28 -7
- package/dist/usage.js.map +1 -1
- package/package.json +3 -3
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1,34 +1,63 @@
|
|
|
1
1
|
# locale-keysmith
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/locale-keysmith)
|
|
4
|
+
[](https://github.com/faysalakash/locale-keysmith/actions/workflows/test.yml)
|
|
5
|
+
[](LICENSE)
|
|
6
|
+
|
|
7
|
+
Keep your i18n locale files complete and tidy, from the command line or in CI.
|
|
8
|
+
|
|
9
|
+
locale-keysmith finds your locale files (JSON or YAML), compares every translation with the
|
|
10
|
+
source language, and checks which keys your code still uses. It can then sort the files,
|
|
11
|
+
delete unused keys, and fill in missing translations with Google Translate.
|
|
12
|
+
|
|
13
|
+
- **Audit:** one `health` command reports missing, extra, unused, duplicate and empty keys,
|
|
14
|
+
type mismatches and unsorted files.
|
|
15
|
+
- **Clean up:** `sort` and `remove-unused` rewrite files while keeping their indentation, line
|
|
16
|
+
endings and YAML comments.
|
|
17
|
+
- **Translate:** fill missing keys via Google Translate, with `{{placeholders}}`, ICU messages
|
|
18
|
+
and `<0>tags</0>` kept intact.
|
|
19
|
+
- **CI-ready:** `--json` output, and exit codes that tell "issues found" apart from "the check
|
|
20
|
+
itself failed".
|
|
21
|
+
- **Zero config:** works out of the box for a `src` folder; `init` writes a config for
|
|
22
|
+
anything else.
|
|
23
|
+
|
|
24
|
+
## Works with
|
|
25
|
+
|
|
26
|
+
locale-keysmith is built around **i18next** conventions, as used by react-i18next,
|
|
27
|
+
next-i18next and i18next-http-backend: plural suffixes (`_one`, `_other`, ...), context,
|
|
28
|
+
namespaces and `keyPrefix` are all understood.
|
|
29
|
+
|
|
30
|
+
Other libraries that keep translations in JSON/YAML key files and read them with `t("key")`
|
|
31
|
+
or `$t("key")` (vue-i18n, for example) work for the key checks, but plural forms are checked
|
|
32
|
+
by i18next's rules.
|
|
4
33
|
|
|
5
34
|
## Install
|
|
6
35
|
|
|
7
36
|
```bash
|
|
8
|
-
|
|
37
|
+
npm install --save-dev locale-keysmith
|
|
38
|
+
# or: pnpm add -D locale-keysmith
|
|
39
|
+
# or: yarn add -D locale-keysmith
|
|
9
40
|
```
|
|
10
41
|
|
|
42
|
+
Or run it without installing anything: `npx locale-keysmith health`.
|
|
43
|
+
|
|
11
44
|
Requires Node.js 22.12 or newer.
|
|
12
45
|
|
|
13
46
|
## Quick start
|
|
14
47
|
|
|
15
48
|
```bash
|
|
16
|
-
#
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
# See which locale files are detected
|
|
20
|
-
pnpm exec locale-keysmith scan
|
|
21
|
-
|
|
22
|
-
# Get a full report: missing keys, unused keys, and unsorted files
|
|
23
|
-
pnpm exec locale-keysmith health
|
|
49
|
+
npx locale-keysmith init # optional: write a config based on the locale files found
|
|
50
|
+
npx locale-keysmith scan # see which locale files are detected
|
|
51
|
+
npx locale-keysmith health # report everything that needs attention
|
|
24
52
|
```
|
|
25
53
|
|
|
26
|
-
By default everything is scanned under the `src` folder. To look elsewhere,
|
|
27
|
-
file (see [Configuration](#configuration)).
|
|
54
|
+
By default everything is scanned under the `src` folder. To look elsewhere, run `init` or add
|
|
55
|
+
a config file (see [Configuration](#configuration)).
|
|
28
56
|
|
|
29
57
|
## Commands
|
|
30
58
|
|
|
31
|
-
|
|
59
|
+
The examples use `npx locale-keysmith <command>`; with pnpm or yarn, `pnpm exec` or `yarn`
|
|
60
|
+
work the same way.
|
|
32
61
|
|
|
33
62
|
| Command | What it does |
|
|
34
63
|
| -------------------------- | ------------------------------------------------------------------------ |
|
|
@@ -41,36 +70,11 @@ Run a command with `pnpm exec locale-keysmith <command>` (or `npx locale-keysmit
|
|
|
41
70
|
| `remove-unused` | Delete unused keys from every locale file. |
|
|
42
71
|
| `translate --to <locales>` | Fill missing keys in target locales via Google Translate. |
|
|
43
72
|
|
|
44
|
-
### Using it in CI
|
|
45
|
-
|
|
46
|
-
`scan`, `missing`, `unused` and `health` accept `--json` and print a machine-readable
|
|
47
|
-
result on stdout (warnings go to stderr, so stdout always parses):
|
|
48
|
-
|
|
49
|
-
```bash
|
|
50
|
-
pnpm exec locale-keysmith health --json
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
```json
|
|
54
|
-
{
|
|
55
|
-
"healthy": false,
|
|
56
|
-
"issueCount": 1,
|
|
57
|
-
"issues": [{ "type": "missing", "file": "src/locales/de.json", "locale": "de", "key": "status.offline" }]
|
|
58
|
-
}
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
Exit codes:
|
|
62
|
-
|
|
63
|
-
| Code | Meaning |
|
|
64
|
-
| ---- | --------------------------------------------------------------------------------- |
|
|
65
|
-
| `0` | Nothing to report. |
|
|
66
|
-
| `1` | `missing`, `unused` or `health` found something. |
|
|
67
|
-
| `2` | The command itself failed (invalid config, unreadable locale file, API error...). |
|
|
68
|
-
|
|
69
73
|
### `init`
|
|
70
74
|
|
|
71
75
|
```bash
|
|
72
|
-
|
|
73
|
-
|
|
76
|
+
npx locale-keysmith init # refuses to overwrite an existing config
|
|
77
|
+
npx locale-keysmith init --force # overwrite it
|
|
74
78
|
```
|
|
75
79
|
|
|
76
80
|
Looks for locale files in the project (skipping `node_modules`, build output, and test or
|
|
@@ -84,14 +88,14 @@ fixture folders) and writes a config with:
|
|
|
84
88
|
### `scan`
|
|
85
89
|
|
|
86
90
|
```bash
|
|
87
|
-
|
|
91
|
+
npx locale-keysmith scan
|
|
88
92
|
```
|
|
89
93
|
|
|
90
|
-
Prints one line per detected locale file
|
|
91
|
-
|
|
92
|
-
|
|
94
|
+
Prints one line per detected locale file. Matched JSON/YAML files that are not locale files
|
|
95
|
+
(see [How locale files are recognised](#how-locale-files-are-recognised)) are listed
|
|
96
|
+
underneath as skipped, so you can see why a file you expected is missing:
|
|
93
97
|
|
|
94
|
-
```
|
|
98
|
+
```text
|
|
95
99
|
en src/locales/en.json
|
|
96
100
|
de src/locales/de.json
|
|
97
101
|
|
|
@@ -104,12 +108,12 @@ With `--json`, the skipped files are in the `skipped` array.
|
|
|
104
108
|
### `health`
|
|
105
109
|
|
|
106
110
|
```bash
|
|
107
|
-
|
|
111
|
+
npx locale-keysmith health
|
|
108
112
|
```
|
|
109
113
|
|
|
110
114
|
A one-shot audit. It prints each problem it finds:
|
|
111
115
|
|
|
112
|
-
```
|
|
116
|
+
```text
|
|
113
117
|
unsorted src/locales/de.json
|
|
114
118
|
duplicate en nav.home
|
|
115
119
|
missing de status.offline
|
|
@@ -138,7 +142,7 @@ are skipped by every check.
|
|
|
138
142
|
### `missing`
|
|
139
143
|
|
|
140
144
|
```bash
|
|
141
|
-
|
|
145
|
+
npx locale-keysmith missing
|
|
142
146
|
```
|
|
143
147
|
|
|
144
148
|
Lists, per non-source locale, the keys that exist in the source locale but are absent.
|
|
@@ -151,7 +155,7 @@ Japanese only needs `item_other`. Neither is reported as missing or extra for do
|
|
|
151
155
|
### `unused`
|
|
152
156
|
|
|
153
157
|
```bash
|
|
154
|
-
|
|
158
|
+
npx locale-keysmith unused
|
|
155
159
|
```
|
|
156
160
|
|
|
157
161
|
Lists source-locale keys that are never referenced in your source files. See
|
|
@@ -160,8 +164,8 @@ Lists source-locale keys that are never referenced in your source files. See
|
|
|
160
164
|
### `sort`
|
|
161
165
|
|
|
162
166
|
```bash
|
|
163
|
-
|
|
164
|
-
|
|
167
|
+
npx locale-keysmith sort # preview (no changes written)
|
|
168
|
+
npx locale-keysmith sort --write # write sorted files to disk
|
|
165
169
|
```
|
|
166
170
|
|
|
167
171
|
Sorts keys alphabetically at every nesting level. Without `--write` it only reports which
|
|
@@ -170,20 +174,24 @@ files would change.
|
|
|
170
174
|
### `remove-unused`
|
|
171
175
|
|
|
172
176
|
```bash
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
177
|
+
npx locale-keysmith remove-unused # preview
|
|
178
|
+
npx locale-keysmith remove-unused --dry-run # preview (explicit)
|
|
179
|
+
npx locale-keysmith remove-unused --write # delete unused keys and re-sort
|
|
176
180
|
```
|
|
177
181
|
|
|
178
182
|
Removes unused keys from **every** locale file (not just the source), then re-sorts them.
|
|
179
183
|
It lists every key it removes; without `--write` it only lists the keys that would be removed.
|
|
180
184
|
|
|
185
|
+
> **Warning:** `--write` deletes translations. Commit your work first and read the list it prints: a key
|
|
186
|
+
> that your code builds entirely at runtime cannot be detected (see
|
|
187
|
+
> [Key usage detection](#key-usage-detection)). Protect such keys with `ignoreKeys`.
|
|
188
|
+
|
|
181
189
|
### `translate`
|
|
182
190
|
|
|
183
191
|
```bash
|
|
184
192
|
export GOOGLE_TRANSLATE_API_KEY="your-api-key"
|
|
185
|
-
|
|
186
|
-
|
|
193
|
+
npx locale-keysmith translate --to de,fr # preview counts
|
|
194
|
+
npx locale-keysmith translate --from en --to de,fr --write
|
|
187
195
|
```
|
|
188
196
|
|
|
189
197
|
Translates the source locale's missing keys into each target locale using the Google
|
|
@@ -207,6 +215,65 @@ never in the URL.
|
|
|
207
215
|
before the error is reported, so rerunning only translates what is left.
|
|
208
216
|
- Keys are sent in batches of up to 100 strings per request.
|
|
209
217
|
|
|
218
|
+
#### Getting an API key
|
|
219
|
+
|
|
220
|
+
1. In the [Google Cloud console](https://console.cloud.google.com/), create or select a
|
|
221
|
+
project. It needs a billing account.
|
|
222
|
+
2. Enable the **Cloud Translation API** (APIs & Services → Library).
|
|
223
|
+
3. Create a key under APIs & Services → Credentials → **Create credentials → API key**.
|
|
224
|
+
4. Restrict the key to the Cloud Translation API, then export it as `GOOGLE_TRANSLATE_API_KEY`.
|
|
225
|
+
|
|
226
|
+
Google charges per translated character, with a monthly free allowance; see
|
|
227
|
+
[Cloud Translation pricing](https://cloud.google.com/translate/pricing). Run without
|
|
228
|
+
`--write` first to see how many keys would be sent.
|
|
229
|
+
|
|
230
|
+
## Using it in CI
|
|
231
|
+
|
|
232
|
+
`health` fails the job when it finds anything, which makes it a one-line CI check:
|
|
233
|
+
|
|
234
|
+
```yaml
|
|
235
|
+
# .github/workflows/i18n.yml
|
|
236
|
+
name: i18n
|
|
237
|
+
on: pull_request
|
|
238
|
+
|
|
239
|
+
jobs:
|
|
240
|
+
locales:
|
|
241
|
+
runs-on: ubuntu-latest
|
|
242
|
+
steps:
|
|
243
|
+
- uses: actions/checkout@v7
|
|
244
|
+
- uses: actions/setup-node@v7
|
|
245
|
+
with:
|
|
246
|
+
node-version: 22
|
|
247
|
+
- run: npx --yes locale-keysmith@0 health
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
If locale-keysmith is a dev dependency, run your install step (`npm ci`) and then
|
|
251
|
+
`npx locale-keysmith health`, so CI uses the version in your lockfile. To check only for
|
|
252
|
+
missing translations, use `missing` instead of `health`.
|
|
253
|
+
|
|
254
|
+
Exit codes:
|
|
255
|
+
|
|
256
|
+
| Code | Meaning |
|
|
257
|
+
| ---- | --------------------------------------------------------------------------------- |
|
|
258
|
+
| `0` | Nothing to report. |
|
|
259
|
+
| `1` | `missing`, `unused` or `health` found something. |
|
|
260
|
+
| `2` | The command itself failed (invalid config, unreadable locale file, API error...). |
|
|
261
|
+
|
|
262
|
+
`scan`, `missing`, `unused` and `health` accept `--json` and print a machine-readable
|
|
263
|
+
result on stdout (warnings go to stderr, so stdout always parses):
|
|
264
|
+
|
|
265
|
+
```bash
|
|
266
|
+
npx locale-keysmith health --json
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
```json
|
|
270
|
+
{
|
|
271
|
+
"healthy": false,
|
|
272
|
+
"issueCount": 1,
|
|
273
|
+
"issues": [{ "type": "missing", "file": "src/locales/de.json", "locale": "de", "key": "status.offline" }]
|
|
274
|
+
}
|
|
275
|
+
```
|
|
276
|
+
|
|
210
277
|
## Configuration
|
|
211
278
|
|
|
212
279
|
Configuration is **optional**. With no config file, locale-keysmith scans **only the `src`
|
|
@@ -298,8 +365,15 @@ runtime:
|
|
|
298
365
|
t("cart.item", { count }); // cart.item_one, cart.item_other, cart.item_zero, ... are used
|
|
299
366
|
t("friend.greeting", { context }); // friend.greeting_male, friend.greeting_female, ... are used
|
|
300
367
|
t("common:common.title"); // namespaced: common.title is used
|
|
368
|
+
|
|
369
|
+
const { t } = useTranslation("translation", { keyPrefix: "settings" });
|
|
370
|
+
t("title"); // keyPrefix: settings.title is used (also getFixedT(lng, ns, "settings"))
|
|
301
371
|
```
|
|
302
372
|
|
|
373
|
+
In a file that sets a `keyPrefix`, every key is counted both with and without the prefix,
|
|
374
|
+
since another `t` in the same file may not use it. A `keyPrefix` built at runtime cannot be
|
|
375
|
+
resolved, so keep its keys out of `remove-unused` with `ignoreKeys`.
|
|
376
|
+
|
|
303
377
|
A **dynamically built** key cannot be resolved statically, so every key under its static
|
|
304
378
|
prefix is treated as used. That is never reported or removed:
|
|
305
379
|
|
|
@@ -308,20 +382,14 @@ t(`theme.${mode}`); // every key under theme. (theme.dark, theme.light, ...) is
|
|
|
308
382
|
t("errors." + code); // every key under errors. is used
|
|
309
383
|
```
|
|
310
384
|
|
|
311
|
-
|
|
385
|
+
A key computed entirely at runtime (`t(keyFromServer)`) leaves no trace in the source, so it
|
|
386
|
+
is reported as unused. Add such keys to `ignoreKeys`.
|
|
312
387
|
|
|
313
|
-
|
|
314
|
-
pnpm run lint # ESLint (typescript-eslint, flat config)
|
|
315
|
-
pnpm run format # Prettier --write
|
|
316
|
-
pnpm run test # Vitest
|
|
317
|
-
pnpm run coverage # Vitest with v8 coverage
|
|
318
|
-
pnpm run check # lint + format:check + build + test
|
|
319
|
-
```
|
|
388
|
+
## Contributing
|
|
320
389
|
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
full run sends about 2,000 characters:
|
|
390
|
+
Bug reports and pull requests are welcome. See [CONTRIBUTING.md](CONTRIBUTING.md) for the
|
|
391
|
+
development setup.
|
|
324
392
|
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
393
|
+
## License
|
|
394
|
+
|
|
395
|
+
[MIT](LICENSE) © Faysal Ahmed Akash
|
package/dist/usage.js
CHANGED
|
@@ -12,6 +12,12 @@ const callPatterns = [
|
|
|
12
12
|
];
|
|
13
13
|
// Any quoted string shaped like a dotted key path, wherever it appears.
|
|
14
14
|
const keyLiteralPattern = new RegExp(`(["'\`])(${namespace}${segment}(?:\\.${segment})+)\\1`, "g");
|
|
15
|
+
// `useTranslation("ns", { keyPrefix: "settings" })` / `withTranslation`, and
|
|
16
|
+
// `i18next.getFixedT(lng, ns, "settings")`: the returned t reads `title` as `settings.title`.
|
|
17
|
+
const keyPrefixPatterns = [
|
|
18
|
+
/\bkeyPrefix\s*:\s*(["'`])([^"'`\n]+)\1/g,
|
|
19
|
+
/\bgetFixedT\(\s*[^,()]*,\s*[^,()]*,\s*(["'`])([^"'`\n]+)\1/g
|
|
20
|
+
];
|
|
15
21
|
const prefixPatterns = [
|
|
16
22
|
new RegExp(`\`(${namespace}(?:${segment}\\.)+)\\$\\{`, "g"), // `theme.${mode}`
|
|
17
23
|
new RegExp(`(["'\`])(${namespace}(?:${segment}\\.)+)\\1\\s*\\+`, "g") // "theme." + mode
|
|
@@ -28,19 +34,25 @@ export async function findUsedKeys(cwd = process.cwd()) {
|
|
|
28
34
|
return (await findKeyUsage(cwd)).keys;
|
|
29
35
|
}
|
|
30
36
|
export function collectKeyUsage(content, usage = { keys: new Set(), prefixes: new Set() }) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
37
|
+
const keyPrefixes = literalMatches(content, keyPrefixPatterns);
|
|
38
|
+
const record = (target, key) => {
|
|
39
|
+
addWithoutNamespace(target, key);
|
|
40
|
+
// A keyPrefix is not tied to one particular t, so in a file that sets one, every key is
|
|
41
|
+
// recorded both as written and with each prefix. Erring towards "used" keeps
|
|
42
|
+
// remove-unused from deleting keys that are read through the prefixed t.
|
|
43
|
+
for (const keyPrefix of keyPrefixes) {
|
|
44
|
+
addWithoutNamespace(target, withKeyPrefix(key, keyPrefix));
|
|
36
45
|
}
|
|
46
|
+
};
|
|
47
|
+
for (const key of literalMatches(content, callPatterns)) {
|
|
48
|
+
record(usage.keys, key);
|
|
37
49
|
}
|
|
38
50
|
for (const match of content.matchAll(keyLiteralPattern)) {
|
|
39
|
-
|
|
51
|
+
record(usage.keys, match[2]);
|
|
40
52
|
}
|
|
41
53
|
for (const pattern of prefixPatterns) {
|
|
42
54
|
for (const match of content.matchAll(pattern)) {
|
|
43
|
-
|
|
55
|
+
record(usage.prefixes, match.at(-1));
|
|
44
56
|
}
|
|
45
57
|
}
|
|
46
58
|
return usage;
|
|
@@ -72,6 +84,15 @@ export function isKeyUsed(key, usage) {
|
|
|
72
84
|
}
|
|
73
85
|
return false;
|
|
74
86
|
}
|
|
87
|
+
/** The string literals captured by `patterns`, skipping template literals with `${}` in them. */
|
|
88
|
+
function literalMatches(content, patterns) {
|
|
89
|
+
return patterns.flatMap((pattern) => [...content.matchAll(pattern)].map((match) => match[2]).filter((value) => !value.includes("${")));
|
|
90
|
+
}
|
|
91
|
+
// `common:title` with keyPrefix `settings` reads `settings.title` in the `common` namespace.
|
|
92
|
+
function withKeyPrefix(key, keyPrefix) {
|
|
93
|
+
const separator = key.indexOf(":");
|
|
94
|
+
return `${key.slice(0, separator + 1)}${keyPrefix}.${key.slice(separator + 1)}`;
|
|
95
|
+
}
|
|
75
96
|
// `common:app.title` refers to `app.title` in the `common` namespace; record both forms.
|
|
76
97
|
function addWithoutNamespace(target, key) {
|
|
77
98
|
target.add(key);
|
package/dist/usage.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usage.js","sourceRoot":"","sources":["../src/usage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,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diting, cleaning, and translating i18n locale keys.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"packageManager": "pnpm@12.16.1",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"build": "tsc && tsc-alias --resolve-full-paths",
|
|
24
24
|
"test": "vitest run",
|
|
25
25
|
"test:watch": "vitest",
|
|
26
|
-
"test:live": "
|
|
26
|
+
"test:live": "vitest run --mode live test/translate.live.test.ts",
|
|
27
27
|
"coverage": "vitest run --coverage",
|
|
28
28
|
"lint": "eslint .",
|
|
29
29
|
"lint:fix": "eslint . --fix",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"translation",
|
|
40
40
|
"cli"
|
|
41
41
|
],
|
|
42
|
-
"author": "",
|
|
42
|
+
"author": "Faysal Ahmed Akash",
|
|
43
43
|
"license": "MIT",
|
|
44
44
|
"repository": {
|
|
45
45
|
"type": "git",
|