mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-16 20:05:14 +02:00
change language dynamically - bound to F8 key
This commit is contained in:
parent
75ad3219e6
commit
08032e0453
6 changed files with 64 additions and 0 deletions
18
index.php
18
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);
|
||||
|
||||
|
@ -86,6 +91,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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue