diff options
Diffstat (limited to 'include/language.php')
-rw-r--r-- | include/language.php | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/include/language.php b/include/language.php index cea31924c..c843db85e 100644 --- a/include/language.php +++ b/include/language.php @@ -65,15 +65,22 @@ function get_best_language() { if(isset($langs) && count($langs)) { foreach ($langs as $lang => $v) { $lang = strtolower($lang); - if(file_exists("view/$lang") && is_dir("view/$lang")) { + if(is_dir("view/$lang")) { $preferred = $lang; break; } } } - if(isset($preferred)) - return $preferred; + if(! isset($preferred)) + $preferred = 'unset'; + + $arr = array('langs' => $langs, 'preferred' => $preferred); + + call_hooks('get_best_language',$arr); + + if($arr['preferred'] !== 'unset') + return $arr['preferred']; $a = get_app(); return ((isset($a->config['system']['language'])) ? $a->config['system']['language'] : 'en'); |