aboutsummaryrefslogtreecommitdiffstats
path: root/include/language.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/language.php')
-rw-r--r--include/language.php15
1 files changed, 11 insertions, 4 deletions
diff --git a/include/language.php b/include/language.php
index 59979aa85..121816ae6 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');
@@ -182,7 +189,7 @@ function t($s, $ctx = '') {
function translate_projectname($s) {
- return str_replace(array('$projectname','$Projectname'),array(PLATFORM_NAME,ucfirst(PLATFORM_NAME)),$s);
+ return str_replace(array('$projectname','$Projectname'),array(Zotlabs\Project\System::get_platform_name(),ucfirst(Zotlabs\Project\System::get_platform_name())),$s);
}