Commit Graph
22 Commits
Author SHA1 Message Date
Martin BallandClaude Opus 5.5 c52ee4b87f Draft lists: keep a Draft listed until its current wording is accepted
A Reviewer's acceptance counts only for the wording they accepted: if
main rewords the row after the export, export marks it fuzzy again and
import leaves it on its list. The checker rejects an app Draft for a
shared string's override, which Weblate never offers. A leading BOM no
longer stops a row leaving its list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 15:05:11 +00:00
Martin BallandClaude Opus 5.5 6be2e7a6cd Draft lists: checker and Weblate converter (ADR 0007)
drafts/<locale>/<catalog>.tsv lists a catalog's Drafts as context and
source text. The checker fails an entry whose catalog row is missing or
that is listed twice. The Weblate converter exports listed rows fuzzy
("Needs editing"); when a Reviewer accepts one, import takes it off its
list (unless its row also changed on main) and the sync PR says so.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 14:23:35 +00:00
Morion Tutoriales 3cb11a36a5 Add TextureCraft catalogs migrated from its Rust translation tables (#243)
* Add TextureCraft catalogs and verified Rust-table migration tool

* Document TextureCraft migration helpers and tests
2026-11-11 19:15:35 +01:00
Martin BallandClaude Opus 5.5 4bafe3edb7 PhotoCraft cutover sync: photocraft@848fa30 into locales/
tools/sync_app.py ../photocraft 8d2e615 --ref 848fa306 --app photocraft:
round trip 141,125 rows reproduced, 0 not. 12 new PhotoCraft locales
(ar, az, da, fi, he, hi, nb, ro, sv, ta, th, ur; az new to craft-i18n,
its language.name from PhotoCraft's LANGUAGES). Hebrew: 35 @plural rows
listed one|other; CLDR he has one|two|other, so the other form is
repeated (PhotoCraft clamps the index today, so n=2 already shows it).
tools/plural_forms.tsv gains az.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 14:56:57 +00:00
Martin BallandClaude Opus 5.5 2545512377 tools: weblate_base.sh defaults EXPORT_NAME, so it runs outside CI
Suggested by el-j on #199.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 13:41:50 +00:00
Martin BallandClaude Opus 5.5 58d559271c Weblate bridge: main-only base, scheduled import, keep sync PR additions
Answers FredApps' review on #199:
- The base is main as of the last export, re-rendered from the commit in the
  export message (tools/weblate_base.sh). The export's own output also holds
  pending Weblate changes, so using it lost them after an unrelated export.
- Import runs hourly from main (and on dispatch): the weblate branch has no
  workflow file, so a push there could never start it.
- Each rebuild of weblate/sync replays commits people added to the open PR
  (ATTRIBUTION.md, fixes) and pushes only when the tree changed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 13:04:51 +00:00
Martin BallandClaude Opus 5.5 9bad336ed6 tools: restore the corrections list in weblate_bridge.pr_body
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 10:55:11 +00:00
Martin BallandClaude Opus 5.5 b477243560 Weblate sync PRs are merged by a maintainer, not auto-merged
Review on #191: CI checks the format, not that the text was accepted,
and main doesn't require reviews yet. Revisit with AutoCraft's merge
queue.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 10:45:39 +00:00
Martin BallandClaude Opus 5.5 ef7cd470e0 tools: weblate_bridge refuses rows changed on main since the export
A row whose translation changed both on main and in Weblate since the
last export keeps main's text: import lists it as a conflict (PR body
and an Actions warning) instead of writing it, and export keeps main's
value. Review on #191.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 10:43:42 +00:00
Martin BallandClaude Opus 5.5 f6f874ba2e tools: sort PO entries with absent fields in weblate_bridge.semantic
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 09:55:36 +00:00
Martin BallandClaude Opus 5.5 421adb7de7 tools: Weblate bridge (export, import, PR body) and its workflow
tools/weblate_bridge.py turns locales/ into PO files on the `weblate`
branch and Weblate's accepted translations back into TSV edits. Both
directions diff against the last export commit, so neither a pending
Weblate translation nor a newer main change is lost. Import edits lines
in place and leaves @id rows, shared strings in app components, fuzzy
and incomplete entries alone. .github/workflows/weblate.yml runs export
on pushes to main and import plus the auto-merging `weblate/sync` PR on
Weblate's pushes. Tasks 2, 3 and 5 of the plan (ADR 0006); attribution
from Weblate's API waits for the deploy spike.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 09:45:13 +00:00
Martin BallandClaude Opus 5.5 3190bf08d9 tools: plural forms table for the Weblate converter
`tools/plural_forms.tsv` gives each locale's gettext Plural-Forms in
the catalogs' CLDR form order (integers 0..=1000). A test checks every
row against craft-libs' runtime crate for each n in 0..=1000, so a wrong
order fails CI before any Weblate import. Task 1 of the translation
platform plan (ADR 0006).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 00:42:05 +00:00
tareq 1c05aa72d9 Fix Windows UTF-8 handling in catalog tool tests
The sync/rekey helpers already write UTF-8 catalogs; the tests used the
platform default encoding, so headers with "…" / Français failed under
cp1252. Report paths with forward slashes and run the tool suite in CI.
2026-11-04 08:36:53 +01:00
Martin BallandClaude Opus 5.5 25d71bd95d feat(tools): rekey.py moves translations to an app's corrected English
When an app fixes its English source text without changing the meaning, every
locale's row for the old text is renamed in <app>.tsv, or copied there from
common.tsv (the shared row stays, ADR 0003). A renamed row identical to the
shared row for the new text is dropped. Refuses a change of placeholders or
trailing ellipsis, which would need new translations.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 22:06:50 +00:00
Martin BallandClaude Opus 5.5 4eb8f5d0c0 feat(tools): new_locale.py starter and an "Add a language" guide
tools/new_locale.py <locale> "<name>" [<app> ...] writes the header, the
@id language.name row and every English string the other locales have,
commented out, so a translator uncomments and fills rows and CI passes
from the first commit. It never overwrites an existing file.

The README gets a step-by-step guide: code, starter files (or the web
editor), translate, check, credit, PR, and the app-side language list.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-25 00:09:47 +01:00
Logan Jennings d507d92acb fix(tools): a region of a script variant falls back to the script variant 2026-10-24 12:36:51 -05:00
Logan Jennings 82d2912831 fix(tools): sync_app does not fall back from a script variant to its base language 2026-10-24 11:56:37 -05:00
Dylan M. Taylor f27ed4bf99 Address review suggestions on sync_app.py 2026-10-24 01:46:41 +00:00
Dylan M. Taylor 7af81a07ee Address SonarCloud findings on tools/sync_app.py
Split the high-cognitive-complexity functions (fix, read_app, sync,
main) into small helpers; pass the argument-injection and regex
code smells with sys.argv-independent git() and a PLURAL constant.
2026-10-23 17:48:09 -04:00
Martin BallandClaude Opus 5.5 911f53f7a8 fix(sync_app): skip @msg templates that can never match
Mirrors the checker's check_template (#14): an unclosed {, two
placeholders in a row, or no literal text. Without it a VectorCraft
sync re-adds the dead 'Packaged {n} file(s) in {folder}{note}' row.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B5qjdPbdcyPMikAqXxAAdW
2026-10-22 01:10:27 +01:00
Martin BallandClaude Opus 5.5 53a9634e62 chore: ignore __pycache__; PEP 8 spacing in sync_app.py
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B5qjdPbdcyPMikAqXxAAdW
2026-10-22 00:41:08 +01:00
Martin BallandClaude Opus 5.5 80b2520e45 feat(tools): sync_app.py, app catalogs into locales/ by the migration rules
T3 of the app-wiring plan. Applies what an app changed between the last
synced SHA and --ref (merge-base three-way, so a stale branch never reverts
main), writes only to locales/<l>/<app>.tsv, never common.tsv. --check runs
the round trip. Stdlib only; tests in tools/test_sync_app.py.

docs/integration.md: the two-PR flow, cutover and catch-up before a pin
bump; clone URL now storytold/craft-i18n.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-22 00:41:08 +01:00