[Feature] Give translators a route that does not require editing 3,000-line Dart files #633

Closed
opened 2026-07-22 16:23:33 +00:00 by brenno · 1 comment
Owner

Found in the pre-publication localisation review.

Evidence: find . -name "*.arb" -o -name "*.po" -o -name "*.pot" → zero hits; no Weblate or Crowdin configuration. The strings live in 32 Dart part files totalling 6.4 MB (de.dart 3,019 lines / 2,305 keys; tlh.dart 2,946). tool/add_l10n.dart:146-153 validates up front that every addition covers exactly the 31 target languages and fails otherwise.

Why this matters: an outsider adding one button label must supply 31 translations. An Irish or Maltese native speaker who wants to improve a single bad string must survive Dart syntax, a part file and make check. Both barriers push away precisely the contribution this project needs — native review of 31 languages — and toward machine translation. Not a launch blocker, but it decides whether the community grows after launch.

Proposal: two small things, no platform. (1) A tool/ target that exports one language to, and imports it from, a flat key/value file (JSON or PO), so a translator never sees Dart — half of this already exists inside add_l10n.dart. (2) Split the requirement: a new string still needs 31 languages (the gate), but a correction to one language should be able to land as a standalone pull request. Document that second route in CONTRIBUTING.

See also the separate issue on the missing translation policy for contributors, which is the blocking half of this.

Found in the pre-publication localisation review. **Evidence:** `find . -name "*.arb" -o -name "*.po" -o -name "*.pot"` → zero hits; no Weblate or Crowdin configuration. The strings live in 32 Dart `part` files totalling 6.4 MB (`de.dart` 3,019 lines / 2,305 keys; `tlh.dart` 2,946). `tool/add_l10n.dart:146-153` validates up front that every addition covers exactly the 31 target languages and fails otherwise. **Why this matters:** an outsider adding one button label must supply 31 translations. An Irish or Maltese native speaker who wants to improve a single bad string must survive Dart syntax, a `part` file and `make check`. Both barriers push away precisely the contribution this project needs — native review of 31 languages — and toward machine translation. Not a launch blocker, but it decides whether the community grows after launch. **Proposal:** two small things, no platform. (1) A `tool/` target that exports one language to, and imports it from, a flat key/value file (JSON or PO), so a translator never sees Dart — half of this already exists inside `add_l10n.dart`. (2) Split the requirement: a *new* string still needs 31 languages (the gate), but a *correction* to one language should be able to land as a standalone pull request. Document that second route in CONTRIBUTING. See also the separate issue on the missing translation policy for contributors, which is the blocking half of this.
Author
Owner

Opgelost in PR #697, op main. Beide punten, geen platform.

(1) De route: make l10n-export LANG_=ga OUT=my-irish.json en make l10n-import LANG_=ga IN=my-irish.json. De Nederlandse bronstring ís de sleutel, dus de vertaler ziet altijd waarvan hij een vertaling maakt.

JSON en geen PO, als keuze: PO is de standaard in vertaalland maar draagt hier niets extra's — geen meervoudsvormen, geen contexten, geen fuzzy-vlaggen — en JSON opent met elk gereedschap zonder gettext. Wél in PO-geest: de bron als sleutel.

Bewust géén sleutels toevoegen. Een import die een onbekende sleutel tegenkomt weigert het hele bestand; dat betekent bijna altijd dat de vertaler op een oudere versie werkte, en stilzwijgend doorgaan is de manier waarop zijn werk half landt.

(2) De gesplitste eis: CONTRIBUTING.md zegt nu dat een PR die één taalbestand raakt en geen sleutels toevoegt zelfstandig welkom is. Dat was de helft die de drempel in stand hield — de 31-taleneis gold voor een string tóevoegen en is voor een verbetering onzinnig streng.

De scherpste test is de ronde-trip zonder wijziging: exporteren en meteen terugimporteren moet nul strings bijwerken. Doet het er wél één, dan verliest of vervormt de heenweg iets, en dan brengt elke vertaalronde ongemerkte wijzigingen mee.

Eén detail dat me verraste: de make-variabele heet LANG_ en niet LANG, want make erft de omgeving en LANG staat op vrijwel elke shell al gezet.

Opgelost in PR #697, op main. Beide punten, geen platform. **(1) De route:** `make l10n-export LANG_=ga OUT=my-irish.json` en `make l10n-import LANG_=ga IN=my-irish.json`. De Nederlandse bronstring ís de sleutel, dus de vertaler ziet altijd waarvan hij een vertaling maakt. **JSON en geen PO**, als keuze: PO is de standaard in vertaalland maar draagt hier niets extra's — geen meervoudsvormen, geen contexten, geen fuzzy-vlaggen — en JSON opent met elk gereedschap zonder gettext. Wél in PO-geest: de bron als sleutel. **Bewust géén sleutels toevoegen.** Een import die een onbekende sleutel tegenkomt weigert het hele bestand; dat betekent bijna altijd dat de vertaler op een oudere versie werkte, en stilzwijgend doorgaan is de manier waarop zijn werk half landt. **(2) De gesplitste eis:** `CONTRIBUTING.md` zegt nu dat een PR die één taalbestand raakt en geen sleutels toevoegt zelfstandig welkom is. Dat was de helft die de drempel in stand hield — de 31-taleneis gold voor een string tóevoegen en is voor een verbetering onzinnig streng. **De scherpste test is de ronde-trip zonder wijziging:** exporteren en meteen terugimporteren moet nul strings bijwerken. Doet het er wél één, dan verliest of vervormt de heenweg iets, en dan brengt elke vertaalronde ongemerkte wijzigingen mee. Eén detail dat me verraste: de make-variabele heet `LANG_` en niet `LANG`, want make erft de omgeving en `LANG` staat op vrijwel elke shell al gezet.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
LibreKAT/Ocideck#633
No description provided.