diff options
author | Haakon Meland Eriksen <haakon.eriksen@far.no> | 2016-02-18 20:33:25 +0100 |
---|---|---|
committer | Haakon Meland Eriksen <haakon.eriksen@far.no> | 2016-02-18 20:33:25 +0100 |
commit | cc264b2d60049a844fe17322fbcb367712a7071f (patch) | |
tree | f1f069a49dd186d4cf21c37a25fb794d6d53e6f2 /include/language.php | |
parent | b77c5ae61e5a208daf4b9431a730db874c487e32 (diff) | |
parent | 33c34984e647f48452d53b93b635f6f517a0f392 (diff) | |
download | volse-hubzilla-cc264b2d60049a844fe17322fbcb367712a7071f.tar.gz volse-hubzilla-cc264b2d60049a844fe17322fbcb367712a7071f.tar.bz2 volse-hubzilla-cc264b2d60049a844fe17322fbcb367712a7071f.zip |
Merge remote-tracking branch 'upstream/master'
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'); |