You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Browse filesBrowse the repository at this point in the historyBrowse files
Fehér Ákos
committed
Release v1.2.0: Add multi-language interface support (en, hu, es, pt-BR, fr, de, it) via embedded i18n catalogs, localized confirm mnemonics, per-language man page and README translations, and release version bumps.
- **Multi-language interface (internationalization / localization).** The whole interactive TUI can now render in a language other than English. A small internal `nftui/i18n` package resolves the interface language once at startup — `--lang <code>` wins, else the POSIX locale environment (`LC_ALL` → `LC_MESSAGES` → `LANG`, with `.codeset` / `@modifier` stripped and `C` / `POSIX` meaning English), else English — and looks strings up in per-language JSON catalogs embedded at build time (`i18n/locales/*.json`) via `//go:embed`, matched with `golang.org/x/text/language`. English is the **source** locale and the fallback for any missing key, so the catalog stays byte-identical to the previous inline strings and existing golden-render tests are unchanged. **Hungarian (`hu`)** is the first shipped translation. Everything user-facing in the TUI is localized: the tree and dashboards, the rule / chain / set views, the create / edit dialogs, the full rule editor (tab bar, section headers, field chrome, empty-states), all footers (~77 key descriptions routed through shared action keys), status/feedback lines, and the delete/quit confirmations (whose highlighted mnemonic gained an `i`/`I` "yes" alias so Hungarian `[I]gen / [N]em` actually works). **nftables' own vocabulary stays English in every language** — attribute names (`type` / `hook` / `priority` / `policy`, `ct state`, `ip saddr`, `limit rate`, …), verdicts, expression keywords, and any copy-pasteable rule syntax — so what you read still matches what `nft` accepts. The `--lang` flag is documented in `--help` and `nftui(1)`; a new README "Language / localization" section explains detection and scope. `--help` / `--version` and the man page themselves are English-only (consumed outside the TUI, and `--help` is handled before the language is resolved). Catalog key parity between languages is enforced by a unit test.
13
+
-**Spanish and Brazilian Portuguese translations.** Two more interface languages ship alongside Hungarian: **Spanish (`es`)** and **Brazilian Portuguese (`pt-BR`)** — full 133-key catalogs covering the whole TUI. Any Spanish locale (`es_ES`, `es_MX`, …) selects the `es` catalog; any Portuguese locale (including `pt` and `pt_PT`) nearest-matches `pt-BR`. The delete/quit confirmations' "yes" mnemonic gained an `s`/`S` alias so the highlighted `[S]í / [N]o` and `[S]im / [N]ão` keys actually work, exactly as the Hungarian `i`/`I` alias does. Dialog label columns keep their alignment with the untranslated nft-keyword labels next to them. The language list is updated in `--help`, both `nftui(1)` man pages, and both READMEs; catalog parity and the new mnemonics are covered by unit tests.
14
+
-**Spanish and Brazilian Portuguese documentation.** The `nftui(1)` man page and the README now ship in Spanish and Brazilian Portuguese as well, alongside the English originals and the Hungarian translations: `man/es/nftui.1` and `man/pt_BR/nftui.1` (fully translated section titles and prose; groff macros, flag names, `nft` syntax and file paths kept verbatim; install targets `/usr/share/man/es/man1/` and `/usr/share/man/pt_BR/man1/`, so a locale-aware `man` picks them from `$LANG` / `$LC_MESSAGES`), plus `README.es.md` and `README.pt-BR.md` (full translations with in-page anchors re-pointed to the translated headings; commands, flags and copy-pasteable syntax stay English). Every README now carries an English · Magyar · Español · Português (BR) language selector, and the man-page install instructions cover all four pages.
15
+
-**French translation.** A fifth interface language: **French (`fr`)** — a full 133-key catalog covering the whole TUI, selected with `--lang fr` or any French locale (`fr_FR`, `fr_CA`, …). The delete/quit confirmations' "yes" mnemonic gained an `o`/`O` alias so the highlighted `[O]ui / [N]on` keys actually work, exactly like the Hungarian `i`/`I` and the Spanish/Portuguese `s`/`S` aliases. Dialog label columns keep their alignment with the untranslated nft-keyword labels next to them. The language list is updated in `--help`, all four `nftui(1)` man pages, and all four READMEs; catalog parity and the new mnemonic are covered by unit tests.
16
+
-**French documentation.** The `nftui(1)` man page and the README also ship in French: `man/fr/nftui.1` (fully translated section titles and prose — NOM / SYNOPSIS / DESCRIPTION / OPTIONS / RACCOURCIS CLAVIER / …; groff macros, flag names, `nft` syntax and file paths kept verbatim; install target `/usr/share/man/fr/man1/`, so a locale-aware `man` picks it from `$LANG` / `$LC_MESSAGES`) and `README.fr.md` (a full translation with in-page anchors re-pointed to the translated headings; commands, flags and copy-pasteable syntax stay English). Every README's language selector now lists all five languages, and the man-page install instructions cover all five pages.
17
+
-**German translation.** A sixth interface language: **German (`de`)** — a full 133-key catalog covering the whole TUI, selected with `--lang de` or any German locale (`de_DE`, `de_AT`, `de_CH`, …). The delete/quit confirmations' `[J]a / [N]ein` mnemonic works via a **language-gated**`j`/`J` alias: unlike the unconditional Hungarian `i`, Spanish/Portuguese `s` and French `o` aliases, `j` only confirms while German is the active language — in every other language a stray `j` (vim-down scroll muscle memory) inside a confirm dialog stays inert instead of confirming a delete. Dialog label columns keep their alignment with the untranslated nft-keyword labels next to them. The language list is updated in `--help`, all five `nftui(1)` man pages, and all five READMEs; catalog parity, the German mnemonic, and the non-German inertness of `j` are covered by unit tests.
18
+
-**German documentation.** The `nftui(1)` man page and the README also ship in German: `man/de/nftui.1` (fully translated section titles and prose — BEZEICHNUNG / ÜBERSICHT / BESCHREIBUNG / OPTIONEN / TASTENKÜRZEL / …; groff macros, flag names, `nft` syntax and file paths kept verbatim; install target `/usr/share/man/de/man1/`, so a locale-aware `man` picks it from `$LANG` / `$LC_MESSAGES`) and `README.de.md` (a full translation with in-page anchors re-pointed to the translated headings; commands, flags and copy-pasteable syntax stay English). Every README's language selector now lists all six languages, and the man-page install instructions cover all six pages.
19
+
-**Italian translation.** A seventh interface language: **Italian (`it`)** — a full 133-key catalog covering the whole TUI, selected with `--lang it` or any Italian locale (`it_IT`, `it_CH`, …). The delete/quit confirmations' `[S]ì / [N]o` mnemonic works through the already-shipped unconditional `s`/`S` alias (shared with Spanish `[S]í` and Portuguese `[S]im`), so no key-handling change was needed. Dialog label columns keep their alignment with the untranslated nft-keyword labels next to them. The language list is updated in `--help`, all six `nftui(1)` man pages, and all six READMEs; catalog parity and the Italian mnemonic are covered by unit tests.
20
+
-**Italian documentation.** The `nftui(1)` man page and the README also ship in Italian: `man/it/nftui.1` (fully translated section titles and prose — NOME / SINOSSI / DESCRIZIONE / OPZIONI / SCORCIATOIE DA TASTIERA / …; groff macros, flag names, `nft` syntax and file paths kept verbatim; install target `/usr/share/man/it/man1/`, so a locale-aware `man` picks it from `$LANG` / `$LC_MESSAGES`) and `README.it.md` (a full translation with in-page anchors re-pointed to the translated headings; commands, flags and copy-pasteable syntax stay English). With this, every supported interface language ships its full documentation pair: the language selector in every README lists all seven languages, and the man-page install instructions cover all seven pages.
0 commit comments