From 3cf908a85e50923b062c2624e340d9ebb4427a78 Mon Sep 17 00:00:00 2001 From: Tom Reijnders Date: Wed, 30 May 2012 20:05:14 +0000 Subject: [PATCH] Fix for labels in the wizard when not able to explicitly set a language git-svn-id: https://xerteonlinetoolkits.googlecode.com/svn/trunk@365 912cdd6b-5c7d-d5a7-a2ba-d0f0cdb91641 --- functions.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/functions.php b/functions.php index ce3e9a12f6..8167966a6a 100755 --- a/functions.php +++ b/functions.php @@ -19,14 +19,14 @@ function _debug($string, $up = 0) /** * Try loading a language file. This will lead to the definition of multiple constants. - * + * * We try and choose the language based on: - * + * * 1. If the user has $_GET['language'] set, then try to use the value of this and persist it in $_SESSION['toolkits_language'] * 2. If the user does not have $_GET['lanauge'] but does have $_SESSION['toolkits_language'] then use this * 3. If none of the above, then check what their browser offers through $_SERVER['HTTP_ACCEPT_LANGUAGE'] and try and use the best one. * 4. If we can't find a language to match the user, then fall back to en_GB (language pack languages/en-GB) - * + * * @param string $file_path * @return boolean true on success; else false. */ @@ -59,7 +59,7 @@ function _load_language_file($file_path) $language_name = "en-GB"; } $language = $language_name; - + $_SESSION['toolkits_language'] = $language; } @@ -70,7 +70,7 @@ function _load_language_file($file_path) { if (file_exists($real_file_path)) { require_once($real_file_path); - } + } else { // stuff will break at this point. @@ -120,6 +120,7 @@ function _include_javascript_file($file_path) $language_name = "en-GB"; } $language = $language_name; + $_SESSION['toolkits_language'] = $language; } @@ -143,7 +144,7 @@ function _include_javascript_file($file_path) { if(file_exists($real_file_path)) { echo ""; - } + } else { // stuff will break at this point.