diff options
-rw-r--r-- | functions.php | 4 | ||||
-rw-r--r-- | login_form.php | 10 |
2 files changed, 12 insertions, 2 deletions
diff --git a/functions.php b/functions.php index 1dd0f4935..f9d91e86e 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 46a7b084c..b12c7b89e 100644 --- a/login_form.php +++ b/login_form.php @@ -7,6 +7,7 @@ <script type="text/javascript" src="pngfix.js"></script> <![endif]--> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> + <script type="text/javascript" src="functions.js"></script> </head> <body> @@ -22,6 +23,11 @@ function init() { login.focus(); } +function languageChange(elem) { + var lang = elem[elem.selectedIndex].value; + setCookie("ttrss_lang", lang); + window.location.reload(); +} </script> <script type="text/javascript"> @@ -53,8 +59,8 @@ window.onload = init; <tr><td align="right"><?php echo __("Language:") ?></td> <td align="right"> <?php - print_select_hash("language", "", get_translations(), - "style='width : 100%'"); + print_select_hash("language", $_COOKIE["ttrss_lang"], get_translations(), + "style='width : 100%' onchange='languageChange(this)'"); ?> </td></tr> |