Not gettext: this harness is meant to start in ten years, and gettext needs msgfmt at build time and .mo files at runtime. So catalogues are 'key = text' files in share/locale, read once at startup. - language from the config key LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_CTYPE="en_US.UTF-8" LC_NUMERIC="en_US.UTF-8" LC_TIME="en_US.UTF-8" LC_COLLATE="en_US.UTF-8" LC_MONETARY="en_US.UTF-8" LC_MESSAGES="en_US.UTF-8" LC_PAPER="en_US.UTF-8" LC_NAME="en_US.UTF-8" LC_ADDRESS="en_US.UTF-8" LC_TELEPHONE="en_US.UTF-8" LC_MEASUREMENT="en_US.UTF-8" LC_IDENTIFICATION="en_US.UTF-8" LC_ALL=, else SPLINTER_LOCALE, LC_ALL, LC_MESSAGES, LANG; regional variants are stripped (de_DE.UTF-8 -> de); - catalogue search: $SPLINTER_LOCALE_DIR, the executable's own directory (so works from any cwd), the source tree, /usr/local/share; - a missing key falls back to English, and a key that exists nowhere is shown as itself - an empty label hides a bug, a visible key does not; - UI labels, roles, sidebar headings, status line, command errors and the shell escape all go through sp_t(); plugins can translate theirs the same way. test_i18n loads both catalogues from share/locale, checks lookups, the fallback chain, printf placeholders, and that de.msg covers every key en.msg has - a translation that silently misses half the UI is worse than none. Seventeen test binaries green.
16 KiB
Executable File
16 KiB
Executable File