X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Flang%2Flanguage.php;h=5b0509258b109e3271478b2197c5d929053ffe45;hb=e3004d8581b1ea3c02bfe2b1e880990309c4459e;hp=ea428fca07b5463e3cfc310142b05ad98a9610ec;hpb=46c5f7a65a7659a44ae8254c63152074363d3987;p=fa-stable.git diff --git a/includes/lang/language.php b/includes/lang/language.php index ea428fca..5b050925 100644 --- a/includes/lang/language.php +++ b/includes/lang/language.php @@ -48,7 +48,7 @@ class language function set_language($code) { - global $path_to_root, $installed_languages; + global $path_to_root, $installed_languages, $GetText; $lang = array_search_value($code, $installed_languages, 'code'); $changed = $this->code != $code || $this->version != @$lang['version']; @@ -67,8 +67,8 @@ class language $this->is_locale_file = file_exists($locale); } - $_SESSION['get_text']->set_language($this->code, $this->encoding); - $_SESSION['get_text']->add_domain($this->code, $path_to_root . "/lang", $this->version); + $GetText->set_language($this->code, $this->encoding); + $GetText->add_domain($this->code, $path_to_root . "/lang", $this->version); // Necessary for ajax calls. Due to bug in php 4.3.10 for this // version set globally in php.ini @@ -79,16 +79,15 @@ class language } } -function _set($key,$value) -{ - $_SESSION['get_text']->set_var($key,$value); -} - if (!function_exists("_")) { function _($text) { - $retVal = $_SESSION['get_text']->gettext($text); + global $GetText; + if (!isset($GetText)) // Don't allow using gettext if not is net. + return $text; + + $retVal = $GetText->gettext($text); if ($retVal == "") return $text; return $retVal;