From 68659d98963d8ff021c77cae623e5682053db033 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sat, 11 Aug 2007 15:42:26 +0100 Subject: [PATCH] change language in login form on the fly --- functions.php | 4 ++++ login_form.php | 10 ++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/functions.php b/functions.php index 1dd0f493..f9d91e86 100644 --- a/functions.php +++ b/functions.php @@ -30,6 +30,10 @@ $lang = _TRANSLATION_OVERRIDE_DEFAULT; } + if ($_COOKIE["ttrss_lang"]) { + $lang = $_COOKIE["ttrss_lang"]; + } + if ($lang) { _setlocale(LC_MESSAGES, $lang); _bindtextdomain("messages", "locale"); diff --git a/login_form.php b/login_form.php index 46a7b084..b12c7b89 100644 --- a/login_form.php +++ b/login_form.php @@ -7,6 +7,7 @@ + @@ -22,6 +23,11 @@ function init() { login.focus(); } +function languageChange(elem) { + var lang = elem[elem.selectedIndex].value; + setCookie("ttrss_lang", lang); + window.location.reload(); +}