summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2013-04-29 15:54:23 +0400
committerAndrew Dolgov <[email protected]>2013-04-29 15:54:23 +0400
commit7b149552cb99a44f1fbeef642ffc60e91b1f61a0 (patch)
tree54c4d22d0078dbd2b3e79773251b74afb8ba2bbe /include
parente57a1507aeb349c9ba7d673048c5ccb43e2d639b (diff)
remove language selector from the login form, store language in the database per-user
Diffstat (limited to 'include')
-rw-r--r--include/functions.php19
-rw-r--r--include/login_form.php8
2 files changed, 7 insertions, 20 deletions
diff --git a/include/functions.php b/include/functions.php
index 38c3eac32..b3130104b 100644
--- a/include/functions.php
+++ b/include/functions.php
@@ -1,6 +1,6 @@
<?php
define('EXPECTED_CONFIG_VERSION', 26);
- define('SCHEMA_VERSION', 119);
+ define('SCHEMA_VERSION', 120);
define('LABEL_BASE_INDEX', -1024);
define('PLUGIN_FEED_BASE_INDEX', -128);
@@ -97,11 +97,12 @@
$lang = _TRANSLATION_OVERRIDE_DEFAULT;
}
- // startup_gettext() is called before session_start() so we can't rely
- // on $_SESSION['language'] here.
+ if ($_SESSION["uid"]) {
+ $pref_lang = get_pref("USER_LANGUAGE", $_SESSION["uid"], false);
- if ($_COOKIE["ttrss_lang"] && $_COOKIE["ttrss_lang"] != "auto") {
- $lang = $_COOKIE["ttrss_lang"];
+ if ($pref_lang) {
+ $lang = $pref_lang;
+ }
}
if ($lang) {
@@ -118,8 +119,6 @@
}
}
- startup_gettext();
-
require_once 'db-prefs.php';
require_once 'version.php';
require_once 'ccache.php';
@@ -798,12 +797,8 @@
$_SESSION["last_login_update"] = time();
}
- if ($_SESSION["uid"] && $_SESSION["language"]) {
- setcookie("ttrss_lang", $_SESSION["language"],
- time() + COOKIE_LIFETIME_LONG);
- }
-
if ($_SESSION["uid"]) {
+ startup_gettext();
load_user_plugins($_SESSION["uid"]);
/* cleanup ccache */
diff --git a/include/login_form.php b/include/login_form.php
index 9a20e9be9..b7dae1016 100644
--- a/include/login_form.php
+++ b/include/login_form.php
@@ -202,14 +202,6 @@ function bwLimitChange(elem) {
<?php } ?>
<div class="row">
- <label><?php echo __("Language:") ?></label>
- <?php
- print_select_hash("language", $_COOKIE["ttrss_lang"], get_translations(),
- "style='width : 220px; margin : 0px' dojoType='dijit.form.Select'");
- ?>
- </div>
-
- <div class="row">
<label><?php echo __("Profile:") ?></label>
<span id='profile_box'><select disabled='disabled' dojoType='dijit.form.Select'