Commit a7dce2b4 authored by Franco Fichtner's avatar Franco Fichtner

inc: move back a file to avoid spurious firmware update errors

The GUI upgrade still has serious problems coping with the
fact that it is being updated.  In the latest upgrade the
move of set_language() causes an error so we just avoid it
and do the work again when we can.
parent d9a0054b
......@@ -180,6 +180,18 @@ function setup_polling() {
set_single_sysctl("kern.polling.user_frac", $config['system']['polling_user_frac']);
}
function set_language($lang)
{
$lang_encoding = $lang . '.UTF-8';
$textdomain = 'OPNsense';
putenv('LANG=' . $lang_encoding);
setlocale(LC_ALL, $lang_encoding);
textdomain($textdomain);
bindtextdomain($textdomain, '/usr/local/share/locale');
bind_textdomain_codeset($textdomain, $lang_encoding);
}
/****f* legacy/setup_microcode
* NAME
* enumerates all interfaces and calls enable_hardware_offloading which
......
......@@ -66,14 +66,6 @@ if($config['system']['language'] <> "") {
$g['language'] = 'en_US';
}
function set_language($lang = 'en_US', $encoding = "UTF-8") {
putenv("LANG={$lang}.{$encoding}");
setlocale(LC_ALL, "{$lang}.{$encoding}");
textdomain("pfSense");
bindtextdomain("pfSense","/usr/local/share/locale");
bind_textdomain_codeset("pfSense","{$lang}.{$encoding}");
}
set_language($g['language']);
/* used by progress bar */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment