release 1.19.0: domains.conf lang column drives UI i18n default
Per-stack en|fr lives in domains.conf; load_domain_profile sets TALER_DOMAIN_LANG. FP profiles use lang=fr; workstation LANG=en no longer overrides. HTML chrome resolves lang from the same conf.
This commit is contained in:
parent
d664ad0a6e
commit
793e1577b3
7 changed files with 181 additions and 75 deletions
39
i18n.sh
39
i18n.sh
|
|
@ -3,31 +3,37 @@
|
|||
#
|
||||
# TALER_MON_LANG=en|fr
|
||||
# TALER_MON_LANG_SET=1 → language is explicit (--lang only); do not override.
|
||||
# Auto (SET≠1): domain *lefrancpaysan* / *francpaysan* → fr always (global).
|
||||
# else keep env or en.
|
||||
# Auto (SET≠1), in order:
|
||||
# 1) TALER_DOMAIN_LANG from domains.conf profile (preferred — source of truth)
|
||||
# 2) fallback hostname heuristic *lefrancpaysan*/*francpaysan* → fr
|
||||
# 3) else keep workstation env TALER_MON_LANG or en
|
||||
#
|
||||
# Important: a bare TALER_MON_LANG=en in ~/.config/taler-monitoring/env is only the
|
||||
# workstation default for non-FP domains. It must NEVER lock English on FP
|
||||
# (*lefrancpaysan* / *francpaysan*) — local laptop and host-agent both follow this.
|
||||
# domains.conf column `lang` (see suite domains.conf) is the global definition.
|
||||
# Bare TALER_MON_LANG=en in ~/.config must not override a profile lang=fr.
|
||||
|
||||
: "${TALER_MON_LANG:=}"
|
||||
: "${TALER_MON_LANG_SET:=0}"
|
||||
: "${TALER_DOMAIN_LANG:=}"
|
||||
|
||||
i18n_init() {
|
||||
# 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
|
||||
;;
|
||||
*)
|
||||
# Non-FP: keep pre-set env value if any, else English
|
||||
if [ -z "${TALER_MON_LANG:-}" ]; then
|
||||
TALER_MON_LANG=en
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
if [ -n "${TALER_DOMAIN_LANG:-}" ]; then
|
||||
TALER_MON_LANG="$TALER_DOMAIN_LANG"
|
||||
else
|
||||
case "${TALER_DOMAIN:-}" in
|
||||
*lefrancpaysan*|*francpaysan*)
|
||||
# fallback if domain not (yet) in domains.conf
|
||||
TALER_MON_LANG=fr
|
||||
;;
|
||||
*)
|
||||
if [ -z "${TALER_MON_LANG:-}" ]; then
|
||||
TALER_MON_LANG=en
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
fi
|
||||
case "${TALER_MON_LANG}" in
|
||||
fr|FR|fra|french) TALER_MON_LANG=fr ;;
|
||||
|
|
@ -35,6 +41,7 @@ i18n_init() {
|
|||
esac
|
||||
export TALER_MON_LANG
|
||||
export TALER_MON_LANG_SET
|
||||
export TALER_DOMAIN_LANG
|
||||
}
|
||||
|
||||
i18n_tag() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue