ext-localize 0.0.0-stage → 0.2.1

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/CHANGELOG.md ADDED
@@ -0,0 +1,42 @@
1
+ # Changelog
2
+
3
+ ## 0.2.1 (2026-11-18)
4
+
5
+ Fixes from the first real use on a live Chrome Web Store item (32 locales).
6
+
7
+ ### Fixed
8
+
9
+ - **CRITICAL: `push chrome --copy` could put garbled text on the clipboard.** `pbcopy` decodes its input with the shell's locale. With no `LANG` / `LC_ALL` / `LC_CTYPE` set (agent shells, GUI-launched shells, CI, `env -i`), it read the UTF-8 script as MacRoman, so every non-ASCII character was garbled. The tool still printed "Copied", and the script's own check passed, because it compared the page with the already-garbled text. Three layers of protection now:
10
+ - The paste script (and the diagnose script) are pure ASCII: every non-ASCII character is written as a `\uXXXX` escape (surrogate pairs for emoji). No clipboard or encoding step can change them.
11
+ - `--copy` runs `pbcopy` and `pbpaste` with `LC_ALL=en_US.UTF-8`, reads the clipboard back and compares it with the file. On a mismatch it exits 1 and never prints "Copied".
12
+ - Each description in the script carries its length in characters and a short SHA-256 hash, computed by the CLI from the listing files. The script fills nothing if any embedded text does not match, and its verify pass checks the page text against them. The report shows `length`, `wantLength` and `sha` per language.
13
+ - `check` no longer reports CLDR plural key families (`*_zero/_one/_two/_few/_many/_other`) as missing or extra keys. Each locale is checked against its own plural categories from `Intl.PluralRules`. `translate` keeps a locale's extra plural forms instead of deleting them and does not add forms the language does not use. See README "Plural keys".
14
+ - An absolute `listing.dir` was silently ignored. It is now used as is. A configured listing folder that does not exist is an error (exit 2).
15
+ - Listing messages showed `listing/<file>` even with another `listing.dir`. They now show the real path, matching the `file` field in `--json`.
16
+ - The warning for locale folders such as `nb` no longer says Chrome ignores or rejects them. The store does not offer them; the Chrome runtime may still use them.
17
+ - The RTL "may be untranslated" warning is quieter: it skips glossary `keep` terms, messages with fewer than 4 letters (`A4`, `KB`, `v1.x`) and short messages identical to the source (brand names).
18
+
19
+ ### Added
20
+
21
+ - `--config <file>` on every command: `state.json`, `glossary.json` and `out/` are kept next to that file, so a build tool that wipes the extension folder (WXT, Plasmo) does not delete them. Relative paths inside the config are resolved from the folder that holds its folder.
22
+ - `--listing-dir <dir>` on every command.
23
+ - `ext-localize listing import <folder | "path/{locale}.txt">`: turns existing per-locale description files into listing files.
24
+ - `check --listing-only`.
25
+ - `check --zip <file>` and `push chrome --zip <file>`: compare the listing files with the `_locales` folders inside the package you upload.
26
+ - `check` text output ends with `OK` or `FAILED (...)`.
27
+ - `push chrome` prints the script size.
28
+
29
+ ### Changed
30
+
31
+ - Listing problems in `check` now start with `listing: <path>` (for example `listing: ../store/listing/de.json: invalid JSON`).
32
+ - `fill-core.js` is 0.2.1: integrity check, code-point lengths in the report.
33
+ - `push chrome --copy` on a system other than macOS now exits 1 (it cannot copy); before, it printed a note and exited 0.
34
+
35
+ ## 0.2.0 (2026-11-17)
36
+
37
+ - Store listing pack (`translate --listing`, listing checks), `push firefox`, `push chrome` (paste script and experimental `--auto`), `push edge`, `.localizer/config.json`.
38
+ - `check --stale`, `file` and `line` on issues, `translate --json`, exit code 3 for "no target locales".
39
+
40
+ ## 0.1.0 (2026-11-16)
41
+
42
+ - `translate` (Anthropic, OpenAI, DeepL, Ollama) and `check` for `_locales`, diff state in `.localizer/state.json`, glossary.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 ext-localize contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.