From 7ca9b5c97ac4f0218929b6e0a7a6dfc22c311282 Mon Sep 17 00:00:00 2001 From: Xavier Roche Date: Sun, 28 Jun 2026 11:57:04 +0200 Subject: [PATCH] lang: add a translation guide and fix the English colon spacing Document the lang/*.txt format and contribution flow in lang/README.md (linked from CONTRIBUTING.md); the project had no written instructions for translators. Also drop the stray space before the colon in the English "Filters (refuse/accept links):" label so it matches the other labels. Only the English.txt value is changed, not the msgid key, so existing translations still resolve. Closes #74 Closes #75 Co-Authored-By: Claude Opus 4.8 Signed-off-by: Xavier Roche --- CONTRIBUTING.md | 4 ++++ lang/English.txt | 2 +- lang/README.md | 37 +++++++++++++++++++++++++++++++++++++ 3 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 lang/README.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 735cc590..52e1508a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -39,6 +39,10 @@ Welcome, and nothing to disclose. Two rules: The sign-off covers AI-assisted code too. +## Translations + +Interface strings live in [`lang/`](lang/). See [lang/README.md](lang/README.md) for the file format and how to add or update a language. + ## Bugs Open an issue with the version, OS, command used, and expected vs actual result. diff --git a/lang/English.txt b/lang/English.txt index 3454c2f3..bf89296d 100644 --- a/lang/English.txt +++ b/lang/English.txt @@ -295,7 +295,7 @@ Max Depth Maximum external depth: Maximum external depth: Filters (refuse/accept links) : -Filters (refuse/accept links) : +Filters (refuse/accept links): Paths Paths Save prefs diff --git a/lang/README.md b/lang/README.md new file mode 100644 index 00000000..ac0a94dd --- /dev/null +++ b/lang/README.md @@ -0,0 +1,37 @@ +# Translating HTTrack + +Interface strings live here, one `.txt` file per language. `English.txt` is the reference: every other file maps each English string to its translation. + +## File format + +Plain text, entries in consecutive pairs of lines: + +``` + + +``` + +The first line of a pair is the lookup key and must stay identical to the one in `English.txt`; translate only the second line. Missing entries fall back to the English text at runtime, so a partial translation works. + +Preserve any `\r\n`, `\t` and `printf` placeholders (`%s`, `%d`, ...) in the translation. + +A few `LANGUAGE_*` entries at the top describe the file itself: + +| Key | Meaning | +| --- | --- | +| `LANGUAGE_NAME` | Name shown in the language picker, in its own language (`Deutsch`, not `German`) | +| `LANGUAGE_ISO` | ISO 639 code, with region if needed (`de`, `pt_BR`) | +| `LANGUAGE_CHARSET` | Encoding the file is saved in (`ISO-8859-1`, `windows-1251`, `UTF-8`, ...) | +| `LANGUAGE_AUTHOR` | Your name and contact | +| `LANGUAGE_WINDOWSID` | Windows locale name used by WinHTTrack (`German (Standard)`) | + +Save the file in exactly its declared `LANGUAGE_CHARSET`; an editor that rewrites it as UTF-8 will corrupt the non-ASCII bytes. + +## Adding or updating a language + +1. Copy `English.txt` to `.txt`, or edit the existing file. +2. Translate each second line; leave the English keys untouched. +3. Fill in the `LANGUAGE_*` header for a new file. +4. Open a pull request, or attach the file to a GitHub issue. + +When new strings land in `English.txt` they show up untranslated (as English) until a translator fills them in.