]> git.mxchange.org Git - friendica.git/blobdiff - index.php
"notes" app
[friendica.git] / index.php
index ab722df2aa3533ff5a99058473213ee771a6281e..05eef6c6e0bfe0f2e7475b29798ff96866702e6d 100644 (file)
--- a/index.php
+++ b/index.php
@@ -1,5 +1,7 @@
 <?php
+
 error_reporting(E_ERROR | E_WARNING | E_PARSE);
+
 /**
  *
  * Friendika
@@ -42,6 +44,7 @@ if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
 } else {
        $lang = ((isset($a->config['system']['language'])) ? $a->config['system']['language'] : 'en');
 }
+
        
 load_translation_table($lang);
 
@@ -86,6 +89,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.