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.
@@ -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-Bx7davi7.js"></script>
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.5",
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: Manage translations in a repo that uses glotfile (a local-first, git-native translation catalog). Use when working in a project containing a glotfile.json or glotfile/ directory, or when the user asks to add/edit/translate/export strings, work with locales/i18n, or run any `glotfile` command. Covers the CLI workflows, the glotfile.json schema, adding and editing strings, glossary, and project conventions.
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 [--dev]` — start the local web UI (the default command when none is
14
- given). Opens a browser at a local URL. `--dev` runs the UI from source with hot reload
15
- (the API runs on a separate port; open the Vite URL, not the API port). With
16
- `config.autoExport` on (the default), serving re-exports to disk on every change.
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>]` AI-translate
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.