<tr><td align="right"><?php echo __("Password:") ?></td>
<td align="right"><input type="password" name="password"
value="<?php echo $_SESSION["fake_password"] ?>"></td></tr>
- <tr><td align="right"><?php echo __("Language:") ?></td>
- <td align="right">
- <?php
- print_select_hash("language", $_COOKIE["ttrss_lang"], get_translations(),
- "style='width : 100%''");
-
- ?>
- </td></tr>
<tr><td colspan='2'>
<button type="submit">
<?php echo __('Log in') ?></button>
if (authenticate_user($login, $password)) {
$_POST["password"] = "";
- $_SESSION["language"] = $_POST["language"];
+ $_SESSION["language"] = get_pref("USER_LANGUAGE", $_SESSION["uid"], false);
$_SESSION["ref_schema_version"] = get_schema_version(true);
$_SESSION["bw_limit"] = !!$_POST["bw_limit"];
"USER_STYLESHEET" => array(__("Customize stylesheet"), __("Customize CSS stylesheet to your liking")),
"USER_TIMEZONE" => array(__("User timezone"), ""),
"VFEED_GROUP_BY_FEED" => array(__("Group headlines in virtual feeds"), __("Special feeds, labels, and categories are grouped by originating feeds")),
+ "USER_LANGUAGE" => array(__("Language")),
"USER_CSS_THEME" => array(__("Select theme"), __("Select one of the available CSS themes"))
);
}
}
}
- if ($pref_name == "language") {
+ if ($pref_name == "USER_LANGUAGE") {
if ($_SESSION["language"] != $value) {
- setcookie("ttrss_lang", $value,
- time() + COOKIE_LIFETIME_LONG);
- $_SESSION["language"] = $value;
-
$need_reload = true;
}
- } else {
- set_pref($pref_name, $value);
}
+ set_pref($pref_name, $value);
}
if ($need_reload) {
print "<tr><td colspan=\"3\"><h3>".$section_name."</h3></td></tr>";
$lnum = 0;
-
- if ($active_section == 2) {
- print "<tr>";
-
- print "<td width=\"40%\" class=\"prefName\">";
- print "<label>";
- print __("Language:");
- print "</label>";
-
- print "<td>";
- print_select_hash("language", $_COOKIE["ttrss_lang"], get_translations(),
- "style='width : 220px; margin : 0px' dojoType='dijit.form.Select'");
- print "</td>";
- print "</tr>";
- }
-
}
print "<tr>";
print "<td class=\"prefValue\">";
- if ($pref_name == "USER_TIMEZONE") {
+ if ($pref_name == "USER_LANGUAGE") {
+ print_select_hash($pref_name, $value, get_translations(),
+ "style='width : 220px; margin : 0px' dojoType='dijit.form.Select'");
+
+ } else if ($pref_name == "USER_TIMEZONE") {
$timezones = explode("\n", file_get_contents("lib/timezones.txt"));
<?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);
$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) {
}
}
- startup_gettext();
-
require_once 'db-prefs.php';
require_once 'version.php';
require_once 'ccache.php';
$_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 */
<?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>
create table ttrss_version (schema_version int not null) ENGINE=InnoDB DEFAULT CHARSET=UTF8;
-insert into ttrss_version values (119);
+insert into ttrss_version values (120);
create table ttrss_enclosures (id integer primary key auto_increment,
content_url text not null,
insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('_ENABLED_PLUGINS', 2, '', 1);
insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('_MOBILE_REVERSE_HEADLINES', 1, 'false', 1);
insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('USER_CSS_THEME', 2, '', 2);
+insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('USER_LANGUAGE', 2, '', 2);
update ttrss_prefs set access_level = 1 where pref_name in ('ON_CATCHUP_SHOW_NEXT_FEED',
'SORT_HEADLINES_BY_FEED_DATE',
create table ttrss_version (schema_version int not null);
-insert into ttrss_version values (119);
+insert into ttrss_version values (120);
create table ttrss_enclosures (id serial not null primary key,
content_url text not null,
insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('_ENABLED_PLUGINS', 2, '', 1);
insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('_MOBILE_REVERSE_HEADLINES', 1, 'false', 1);
insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('USER_CSS_THEME', 2, '', 2);
+insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('USER_LANGUAGE', 2, '', 2);
update ttrss_prefs set access_level = 1 where pref_name in ('ON_CATCHUP_SHOW_NEXT_FEED',
'SORT_HEADLINES_BY_FEED_DATE',
--- /dev/null
+begin;
+
+insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('USER_LANGUAGE', 2, '', 2);
+
+update ttrss_version set schema_version = 120;
+
+commit;
--- /dev/null
+begin;
+
+insert into ttrss_prefs (pref_name,type_id,def_value,section_id) values('USER_LANGUAGE', 2, '', 2);
+
+update ttrss_version set schema_version = 120;
+
+commit;