aboutsummaryrefslogtreecommitdiffstats
path: root/include/language.php
diff options
context:
space:
mode:
authorAlexandre Hannud Abdo <abdo@member.fsf.org>2014-05-23 10:16:03 -0300
committerAlexandre Hannud Abdo <abdo@member.fsf.org>2014-05-23 10:16:03 -0300
commitbc389ff9341d8efec367b2b07c2d1b55be11b8d0 (patch)
treea8bff2409bc07bad6315d530d386e74bb6d3f561 /include/language.php
parent691801120d4322364475f24bdd484ec0ede1ae7b (diff)
downloadvolse-hubzilla-bc389ff9341d8efec367b2b07c2d1b55be11b8d0.tar.gz
volse-hubzilla-bc389ff9341d8efec367b2b07c2d1b55be11b8d0.tar.bz2
volse-hubzilla-bc389ff9341d8efec367b2b07c2d1b55be11b8d0.zip
Language selection: case-insensitive and system language
Fixed ignoring HTTP_ACCEPT_LANGUAGE tags that had uppercase characters. Fixed defining a->language too soon to ever get the system lang
Diffstat (limited to 'include/language.php')
-rw-r--r--include/language.php3
1 files changed, 1 insertions, 2 deletions
diff --git a/include/language.php b/include/language.php
index cfaa855dd..855d94505 100644
--- a/include/language.php
+++ b/include/language.php
@@ -43,8 +43,6 @@ function get_browser_language() {
arsort($langs, SORT_NUMERIC);
}
}
- else
- $langs['en'] = 1;
return $langs;
}
@@ -65,6 +63,7 @@ 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")) {
$preferred = $lang;
break;