system: fix legacy language handing

gettext 0.22.5 broke legacy translation but MVC kept working so
digging through the code this is the additional env vars and
setting that Phalcon does.
This commit is contained in:
Franco Fichtner 2024-04-04 11:18:32 +02:00
parent faf6ab7f21
commit 22e6befe7c

View File

@ -53,9 +53,14 @@ function set_language()
}
$lang_encoding = $lang . '.UTF-8';
$textdomain = 'OPNsense';
putenv('LANG=' . $lang_encoding);
putenv('LANGUAGE=' . $lang_encoding);
putenv('LC_ALL=' . $lang_encoding);
setlocale(LC_ALL, $lang_encoding);
$textdomain = 'OPNsense';
textdomain($textdomain);
bindtextdomain($textdomain, '/usr/local/share/locale');
bind_textdomain_codeset($textdomain, $lang_encoding);