From: Andrew Dolgov Date: Sat, 11 Aug 2007 14:42:26 +0000 (+0100) Subject: change language in login form on the fly X-Git-Tag: 1.2.14~64 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=68659d98963d8ff021c77cae623e5682053db033;p=tt-rss.git change language in login form on the fly --- 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(); +}