aboutsummaryrefslogtreecommitdiffstats
path: root/index.php
diff options
context:
space:
mode:
authorTobias Diekershoff <tobias.diekershoff@gmx.net>2011-03-16 06:52:33 +0100
committerTobias Diekershoff <tobias.diekershoff@gmx.net>2011-03-16 06:52:33 +0100
commitc43f647049c78b594c90e95d06d12f29f300d5d3 (patch)
treea6b02ad763a5d539158721edbe8ca73e158d8ca4 /index.php
parenta2ee5ebe427522228dc03dc81da11f348a399c4d (diff)
parente2ea341094c53e78ae7473a83d2b6c85b1cde4eb (diff)
downloadvolse-hubzilla-c43f647049c78b594c90e95d06d12f29f300d5d3.tar.gz
volse-hubzilla-c43f647049c78b594c90e95d06d12f29f300d5d3.tar.bz2
volse-hubzilla-c43f647049c78b594c90e95d06d12f29f300d5d3.zip
Merge branch 'master' of git://github.com/friendika/friendika
Diffstat (limited to 'index.php')
-rw-r--r--index.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/index.php b/index.php
index cc17119b6..ab722df2a 100644
--- a/index.php
+++ b/index.php
@@ -31,10 +31,17 @@ $install = ((file_exists('.htconfig.php') && filesize('.htconfig.php')) ? false
*
* Get the language setting directly from system variables, bypassing get_config()
* as database may not yet be configured.
+ *
+ * If possible, we use the value from the browser.
*
*/
-$lang = ((isset($a->config['system']['language'])) ? $a->config['system']['language'] : 'en');
+if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
+ $langs = preg_split("/[,-]/",$_SERVER['HTTP_ACCEPT_LANGUAGE'],2);
+ $lang = $langs[0];
+} else {
+ $lang = ((isset($a->config['system']['language'])) ? $a->config['system']['language'] : 'en');
+}
load_translation_table($lang);