From a7dce2b49e51d0e31aefd697a974ce33260d2c3b Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Thu, 2 Apr 2015 19:53:43 +0200 Subject: [PATCH] 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. --- src/etc/inc/pfsense-utils.inc | 12 ++++++++++++ src/www/guiconfig.inc | 8 -------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/etc/inc/pfsense-utils.inc b/src/etc/inc/pfsense-utils.inc index 55cdcee45..fa168fc65 100644 --- a/src/etc/inc/pfsense-utils.inc +++ b/src/etc/inc/pfsense-utils.inc @@ -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 diff --git a/src/www/guiconfig.inc b/src/www/guiconfig.inc index 8cb30c500..ab209aed4 100644 --- a/src/www/guiconfig.inc +++ b/src/www/guiconfig.inc @@ -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 */