mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-10-09 21:54:13 +02:00
Mirror qet_en.ts instead of qet_fr.ts now that English is the source
#1379 added misc/i18n/mirror_source_language.py and an INSTALL.md rule to run it on lang/qet_fr.ts after update_translations, while French was the source language. Since #1390 the code is English and qet_fr.ts is an ordinary translation, so following the rule would copy English text into empty French entries. The repository test still checked qet_fr.ts and kept passing. The rule, the script's description and the repository test now name lang/qet_en.ts. The script refuses a file whose <TS> header names a language different from its sourcelanguage (qet_fr.ts says fr_FR / en), exits 2 and leaves it untouched; files without a sourcelanguage, like the fixtures, are accepted as before. The 6 entries master added since the conversion are mirrored, so qet_en.ts is complete again. Tests: 19 in misc/i18n/test_mirror_source_language.py. The repository test fails on master (6 entries to mirror); with the check_languages() call removed, the two refusal tests fail and a run on qet_fr.ts goes through. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+10
-8
@@ -364,19 +364,21 @@ would happen under `-j`/parallel builds) can corrupt a `.ts` file mid-write,
|
||||
causing `lrelease` to fail with "Premature end of document". Run it on its
|
||||
own, review the diff, and commit the updated `.ts` files separately.
|
||||
|
||||
The strings in the code are French, so `lang/qet_fr.ts` is the source
|
||||
The strings in the code are English, so `lang/qet_en.ts` is the source
|
||||
language's own file. After `update_translations`, run
|
||||
|
||||
```sh
|
||||
python3 misc/i18n/mirror_source_language.py lang/qet_fr.ts
|
||||
python3 misc/i18n/mirror_source_language.py lang/qet_en.ts
|
||||
```
|
||||
|
||||
before committing: it copies every new French source string into its own
|
||||
translation, so `qet_fr.qm` stays complete and French wording can later be
|
||||
before committing: it copies every new English source string into its own
|
||||
translation, so `qet_en.qm` stays complete and English wording can later be
|
||||
corrected in the `.ts` alone, without changing the key that the other
|
||||
languages are attached to. Forgetting it breaks nothing (an empty entry
|
||||
falls back to the code text); `--check` reports whether a run is needed.
|
||||
A French correction typed into `qet_fr.ts` is lost like any other
|
||||
translation when the code string is reworded; the vanished entry keeps the
|
||||
old text for recovery. Never add `-removeidentical` to the `lrelease`
|
||||
options: it would strip these entries again.
|
||||
The script refuses any other language's file, such as `qet_fr.ts`, where it
|
||||
would copy English into a translation. An English correction typed into
|
||||
`qet_en.ts` is lost like any other translation when the code string is
|
||||
reworded; the vanished entry keeps the old text for recovery. Never add
|
||||
`-removeidentical` to the `lrelease` options: it would strip these entries
|
||||
again.
|
||||
|
||||
Reference in New Issue
Block a user