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.
This commit is contained in:
Franco Fichtner 2015-04-02 19:53:43 +02:00
parent d9a0054b7c
commit a7dce2b49e
2 changed files with 12 additions and 8 deletions

View File

@ -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

View File

@ -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 */