glotfile 0.8.5 → 0.8.7
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 +7 -7
- package/dist/server/cli.js +167 -43
- package/dist/server/server.js +161 -41
- package/dist/ui/assets/{index-Bx7davi7.js → index-CVA535xu.js} +92 -19
- package/dist/ui/index.html +1 -1
- package/package.json +25 -1
- package/skill/SKILL.md +1 -1
- package/skill/references/cli-reference.md +25 -8
package/dist/ui/index.html
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>Glotfile</title>
|
|
7
|
-
<script type="module" crossorigin src="/assets/index-
|
|
7
|
+
<script type="module" crossorigin src="/assets/index-CVA535xu.js"></script>
|
|
8
8
|
<link rel="stylesheet" crossorigin href="/assets/index-BaHu118N.css">
|
|
9
9
|
</head>
|
|
10
10
|
<body>
|
package/package.json
CHANGED
|
@@ -1,7 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "glotfile",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.7",
|
|
4
4
|
"description": "Local-first, git-native translation management.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "James Dempster",
|
|
7
|
+
"homepage": "https://github.com/jdempster/glotfile#readme",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/jdempster/glotfile.git"
|
|
11
|
+
},
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/jdempster/glotfile/issues"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [
|
|
16
|
+
"i18n",
|
|
17
|
+
"l10n",
|
|
18
|
+
"translation",
|
|
19
|
+
"localization",
|
|
20
|
+
"internationalization",
|
|
21
|
+
"arb",
|
|
22
|
+
"gettext",
|
|
23
|
+
"xliff",
|
|
24
|
+
"cli"
|
|
25
|
+
],
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"access": "public"
|
|
28
|
+
},
|
|
5
29
|
"type": "module",
|
|
6
30
|
"bin": {
|
|
7
31
|
"glotfile": "bin/glotfile.js"
|
package/skill/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: glotfile
|
|
3
|
-
description:
|
|
3
|
+
description: Use whenever working in a repo that contains a glotfile.json file or a glotfile/ directory, or when the user asks to add, edit, translate, export, import, lint, or prune localized strings, manage locales/i18n/translations, onboard or set up a translation catalog, work with a translation glossary, or run any `glotfile` command — even if they don't say "glotfile" by name. glotfile is a local-first, git-native translation manager whose committed state file is the single source of truth for every locale.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Managing glotfile
|
|
@@ -10,10 +10,12 @@ The state file is auto-detected: a `glotfile/` directory (split layout) wins ove
|
|
|
10
10
|
single `glotfile.json`.
|
|
11
11
|
|
|
12
12
|
## serve
|
|
13
|
-
`glotfile serve [--
|
|
14
|
-
given). Opens a browser at a local URL
|
|
15
|
-
(
|
|
16
|
-
|
|
13
|
+
`glotfile serve [--no-open]` — start the local web UI (the default command when none is
|
|
14
|
+
given). Opens a browser at a local URL; pass `--no-open` to skip launching the browser
|
|
15
|
+
(useful when driving glotfile headlessly). With `config.autoExport` on (the default),
|
|
16
|
+
serving re-exports to disk on every change. (Ignore the `--dev` flag shown in `--help`:
|
|
17
|
+
it's for developing glotfile itself — in that mode this process serves the API only and
|
|
18
|
+
the UI comes from a separate Vite server, so plain `serve` is what you want.)
|
|
17
19
|
|
|
18
20
|
## export
|
|
19
21
|
`glotfile export [--adapter <name>] [--watch]` — write the locale files for every
|
|
@@ -25,13 +27,17 @@ Adapter names: `flutter-arb`, `laravel-php`, `i18next-json`, `vue-i18n-json`,
|
|
|
25
27
|
`gettext-po`, `apple-strings`, `apple-stringsdict`, `angular-xliff`, `rails-yaml`.
|
|
26
28
|
|
|
27
29
|
## translate
|
|
28
|
-
`glotfile translate [--all] [--estimate] [--locale <list>] [--key <glob>]
|
|
29
|
-
strings into the target locales and write the results back into the state file.
|
|
30
|
+
`glotfile translate [--all] [--estimate] [--locale <list>] [--key <glob>] [--batch [--wait]]`
|
|
31
|
+
— AI-translate strings into the target locales and write the results back into the state file.
|
|
30
32
|
- By default only **empty** values are translated (existing translations are left alone).
|
|
31
33
|
- `--all` — re-translate every string, overwriting existing translations.
|
|
32
34
|
- `--estimate` — print batch/token/cost estimates and translate nothing.
|
|
33
35
|
- `--locale fr,de` — restrict to these target locales (alias: `--locales`).
|
|
34
36
|
- `--key <glob>` — only keys matching the glob (e.g. `auth.*`).
|
|
37
|
+
- `--batch` — submit through the provider's batch API (~50% cheaper, runs asynchronously;
|
|
38
|
+
**anthropic only**). Returns immediately with a pending batch; track and apply it with
|
|
39
|
+
`glotfile batch` (see below). Reach for this when the user wants a large/cheap translate.
|
|
40
|
+
- `--wait` — with `--batch`, stay attached and poll until the batch finishes, then apply.
|
|
35
41
|
|
|
36
42
|
Requires a configured AI provider + API key in per-machine local settings.
|
|
37
43
|
|
|
@@ -61,6 +67,7 @@ flat i18next `<lng>.json` files look like vue-i18n, so they need an explicit
|
|
|
61
67
|
`--format i18next-json` (the `public/locales/<lng>/<ns>.json` layout auto-detects).
|
|
62
68
|
- `--source <dir>` — directory to import from (default: the state file's directory).
|
|
63
69
|
- `--source-locale <code>` — which locale is the source of truth.
|
|
70
|
+
- `--locales <list>` — comma-separated locales to import (default: every locale found).
|
|
64
71
|
- `--cldr` — expand CLDR plural forms.
|
|
65
72
|
- `--force` — overwrite an existing `glotfile.json`.
|
|
66
73
|
|
|
@@ -81,9 +88,10 @@ one-time `import`). Format is auto-detected if omitted.
|
|
|
81
88
|
`messages.xlf`.
|
|
82
89
|
|
|
83
90
|
## build-context
|
|
84
|
-
`glotfile build-context [--all] [--key <glob>] [--limit <n>] [--since <date>]` —
|
|
91
|
+
`glotfile build-context [--all] [--key <glob>] [--limit <n>] [--since <date>] [--batch]` —
|
|
85
92
|
AI-generate per-key context (where/how a string is used) to improve translation quality.
|
|
86
|
-
**Requires a prior `glotfile scan`** to index code references.
|
|
93
|
+
**Requires a prior `glotfile scan`** to index code references. `--batch` submits through the
|
|
94
|
+
batch API (anthropic only), like `translate --batch`.
|
|
87
95
|
|
|
88
96
|
## scan
|
|
89
97
|
`glotfile scan` — index the codebase's references to translation keys, writing
|
|
@@ -108,3 +116,12 @@ git diffs on large catalogs. All commands work with either layout.
|
|
|
108
116
|
`glotfile skill [--print] [--force]` — install this Claude Code skill into the current
|
|
109
117
|
repo's `.claude/skills/glotfile/`. `--print` writes `SKILL.md` to stdout instead;
|
|
110
118
|
`--force` overwrites an existing install.
|
|
119
|
+
|
|
120
|
+
## batch
|
|
121
|
+
`glotfile batch [status|apply|cancel]` — manage a pending batch translation that was
|
|
122
|
+
submitted with `glotfile translate --batch`. The batch runs server-side; this command
|
|
123
|
+
checks on it from a later session (the handle is stored locally).
|
|
124
|
+
- `status` (default) — show the pending batch's progress.
|
|
125
|
+
- `apply` — fetch the finished results and write the translations into the state file
|
|
126
|
+
(this happens automatically once the batch has finished).
|
|
127
|
+
- `cancel` — cancel the pending batch and discard its handle.
|