X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Flang%2Flanguage.php;h=0b8ba215021c68587c14f33a58c96e33e90db989;hb=3613e32ad573d5faccb974a421702bdd87583878;hp=8960928377024f8071c6cf0e0b1dfaaab1eb4e29;hpb=9dab04be9d81766f1878d3688ee73d0bcf29f5d2;p=fa-stable.git diff --git a/includes/lang/language.php b/includes/lang/language.php index 89609283..0b8ba215 100644 --- a/includes/lang/language.php +++ b/includes/lang/language.php @@ -26,8 +26,10 @@ class language function language($name, $code, $encoding, $dir = 'ltr') { + global $dflt_lang; + $this->name = $name; - $this->code = $code; + $this->code = $code ? $code : ($dflt_lang ? $dflt_lang : 'en_GB'); $this->encoding = $encoding; $this->dir = $dir; } @@ -45,7 +47,7 @@ class language function set_language($code) { - global $comp_path, $path_to_root, $installed_languages; + global $path_to_root, $installed_languages; $changed = $this->code != $code; $lang = array_search_value($code, $installed_languages, 'code'); @@ -53,7 +55,7 @@ class language if ($lang && $changed) { // flush cache as we can use several languages in one account - flush_dir($comp_path.'/'.user_company().'/js_cache'); + flush_dir(company_path().'/js_cache'); $this->name = $lang['name']; $this->code = $lang['code'];