release 1.15.3: auto-French console for lefrancpaysan domains

Do not treat a non-empty TALER_MON_LANG from env as explicit language.
Domain *lefrancpaysan* selects fr unless TALER_MON_LANG_SET=1 (--lang).
This commit is contained in:
Hernâni Marques 2026-07-19 04:45:12 +02:00
parent c473cfea15
commit 4d44f69bd0
No known key found for this signature in database
3 changed files with 16 additions and 8 deletions

21
i18n.sh
View file

@ -1,23 +1,29 @@
#!/usr/bin/env bash
# i18n.sh — language for taler-monitoring console + HTML chrome
#
# TALER_MON_LANG=en|fr (default en)
# Auto: domains *lefrancpaysan* → fr unless TALER_MON_LANG is set explicitly.
# TALER_MON_LANG=en|fr
# TALER_MON_LANG_SET=1 → language is explicit (--lang or host-agent wrapper); do not override.
# Auto (SET≠1): domain *lefrancpaysan* / *francpaysan* → fr, else keep env or en.
#
# Important: a bare TALER_MON_LANG=en in ~/.config/taler-monitoring/env must NOT lock
# language for FP domains (that used to force English on stage.monnaie…).
: "${TALER_MON_LANG:=}"
: "${TALER_MON_LANG_SET:=0}"
i18n_init() {
if [ -n "${TALER_MON_LANG:-}" ]; then
TALER_MON_LANG_SET=1
fi
if [ "${TALER_MON_LANG_SET}" != "1" ]; then
# Only TALER_MON_LANG_SET=1 is "explicit". Do not promote non-empty TALER_MON_LANG
# to SET=1 — env files often ship LANG=en for the default GOA workstation.
if [ "${TALER_MON_LANG_SET:-0}" != "1" ]; then
case "${TALER_DOMAIN:-}" in
*lefrancpaysan*|*francpaysan*)
TALER_MON_LANG=fr
;;
*)
TALER_MON_LANG=en
# Non-FP: keep pre-set env value if any, else English
if [ -z "${TALER_MON_LANG:-}" ]; then
TALER_MON_LANG=en
fi
;;
esac
fi
@ -26,6 +32,7 @@ i18n_init() {
*) TALER_MON_LANG=en ;;
esac
export TALER_MON_LANG
export TALER_MON_LANG_SET
}
i18n_tag() {