diff options
-rw-r--r-- | src/etc/inc/config.inc | 5 | ||||
-rw-r--r-- | src/etc/inc/pfsense-utils.inc | 8 | ||||
-rw-r--r-- | src/etc/inc/pkg-utils.inc | 1 | ||||
-rwxr-xr-x | src/etc/sshd | 2 | ||||
-rwxr-xr-x | src/usr/local/sbin/pfSense-upgrade | 2 | ||||
-rw-r--r-- | src/usr/local/www/guiconfig.inc | 10 |
6 files changed, 16 insertions, 12 deletions
diff --git a/src/etc/inc/config.inc b/src/etc/inc/config.inc index 1f64b9a..2d98eae 100644 --- a/src/etc/inc/config.inc +++ b/src/etc/inc/config.inc @@ -229,11 +229,6 @@ if (isset($config['system']['timezone']) && } date_default_timezone_set("$timezone"); -if (!function_exists('set_language')) { - require_once("pfsense-utils.inc"); -} -set_language(); - if ($config_parsed == true) { /* process packager manager custom rules */ if (is_dir("/usr/local/pkg/parse_config")) { diff --git a/src/etc/inc/pfsense-utils.inc b/src/etc/inc/pfsense-utils.inc index 5a0a34e..3db6452 100644 --- a/src/etc/inc/pfsense-utils.inc +++ b/src/etc/inc/pfsense-utils.inc @@ -2767,10 +2767,10 @@ function set_language() { $lang .= ".UTF-8"; putenv("LANG={$lang}"); - $r = setlocale(LC_ALL, $lang); - $r = textdomain("pfSense"); - $r = bindtextdomain("pfSense", "/usr/local/share/locale"); - $r = bind_textdomain_codeset("pfSense", $lang); + setlocale(LC_ALL, $lang); + textdomain("pfSense"); + bindtextdomain("pfSense", "/usr/local/share/locale"); + bind_textdomain_codeset("pfSense", $lang); } function get_locale_list() { diff --git a/src/etc/inc/pkg-utils.inc b/src/etc/inc/pkg-utils.inc index 55a0395..daceefb 100644 --- a/src/etc/inc/pkg-utils.inc +++ b/src/etc/inc/pkg-utils.inc @@ -104,6 +104,7 @@ function pkg_env() { global $config, $g; $pkg_env_vars = array( + "LANG" => "C", "HTTP_USER_AGENT" => $user_agent, "ASSUME_ALWAYS_YES" => "true" ); diff --git a/src/etc/sshd b/src/etc/sshd index 2e59824..044cc2b 100755 --- a/src/etc/sshd +++ b/src/etc/sshd @@ -46,9 +46,7 @@ $sshConfigDir = "/etc/ssh"; $keys = array( - array('type' => 'rsa1', 'suffix' => ''), array('type' => 'rsa', 'suffix' => 'rsa_'), - array('type' => 'dsa', 'suffix' => 'dsa_'), array('type' => 'ecdsa', 'suffix' => 'ecdsa_'), array('type' => 'ed25519', 'suffix' => 'ed25519_') ); diff --git a/src/usr/local/sbin/pfSense-upgrade b/src/usr/local/sbin/pfSense-upgrade index 536bb45..5480504 100755 --- a/src/usr/local/sbin/pfSense-upgrade +++ b/src/usr/local/sbin/pfSense-upgrade @@ -662,6 +662,8 @@ do_reboot() { fi } +export LANG=C + pid_file="/var/run/$(basename $0).pid" logfile="/cf/conf/upgrade_log.txt" stdout='/dev/null' diff --git a/src/usr/local/www/guiconfig.inc b/src/usr/local/www/guiconfig.inc index b94018b..21e96ba 100644 --- a/src/usr/local/www/guiconfig.inc +++ b/src/usr/local/www/guiconfig.inc @@ -91,6 +91,11 @@ $navlevelsep = ": "; /* navigation level separator string */ $mandfldhtml = ""; /* display this before mandatory input fields */ $mandfldhtmlspc = ""; /* same as above, but with spacing */ +if (!function_exists('set_language')) { + require_once("pfsense-utils.inc"); +} +set_language(); + /* Some ajax scripts still need access to GUI */ if (!$ignorefirmwarelock) { if (is_subsystem_dirty('firmwarelock')) { @@ -314,7 +319,10 @@ function print_info_box_np($msg, $name="apply", $value="", $showapply=false, $cl $msg = '<div class="pull-left">' . $msg . '</div>'; - if (stristr($msg, gettext("apply")) != false || stristr($msg, gettext("save")) != false || stristr($msg, gettext("create")) != false || $showapply) { + // The $msg string might or might not have had a known translation into the target language. + // So check it against the keywords "apply", "save and "create" in both the target language and English. + if ((stristr($msg, gettext("apply")) != false) || (stristr($msg, gettext("save")) != false) || (stristr($msg, gettext("create")) != false) || + (stristr($msg, "apply") != false) || (stristr($msg, "save") != false) || (stristr($msg, "create") != false) || $showapply) { $msg .= '<form method="post" class="pull-right"><button type="submit" class="btn btn-default" name="'. $name .'" value="' . $value . '">' . $name . '</button>'; if ($_POST['if']) { |