aboutsummaryrefslogtreecommitdiffstats
path: root/index.php
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-03-31 04:57:31 -0700
committerFriendika <info@friendika.com>2011-03-31 04:57:31 -0700
commit08032e04536e67dbf488654a0142350690154c57 (patch)
treebd0fc507e4e25f2f780ea2bc1eaea1a618fb920b /index.php
parent75ad3219e67b803bebf028b69d59f26c44571b3d (diff)
downloadvolse-hubzilla-08032e04536e67dbf488654a0142350690154c57.tar.gz
volse-hubzilla-08032e04536e67dbf488654a0142350690154c57.tar.bz2
volse-hubzilla-08032e04536e67dbf488654a0142350690154c57.zip
change language dynamically - bound to F8 key
Diffstat (limited to 'index.php')
-rw-r--r--index.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/index.php b/index.php
index ab722df2a..9412c1e3b 100644
--- a/index.php
+++ b/index.php
@@ -42,6 +42,11 @@ if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
} else {
$lang = ((isset($a->config['system']['language'])) ? $a->config['system']['language'] : 'en');
}
+if(x($_POST,'system_language'))
+if(x($_SESSION,'language'))
+ $lang = $_SESSION['language'];
+
+
load_translation_table($lang);
@@ -87,6 +92,19 @@ $a->init_pagehead();
session_start();
/**
+ * Language was set earlier, but we can over-ride it in the session.
+ * We have to do it here because the session was just now opened.
+ */
+
+if(x($_POST,'system_language'))
+ $_SESSION['language'] = $_POST['system_language'];
+if((x($_SESSION,'language')) && ($_SESSION['language'] !== $lang)) {
+ $lang = $_SESSION['language'];
+ load_translation_table($lang);
+}
+
+
+/**
*
* For Mozilla auth manager - still needs sorting, and this might conflict with LRDD header.
* Apache/PHP lumps the Link: headers into one - and other services might not be able to parse it