change language in login form on the fly
This commit is contained in:
parent
f8c612d483
commit
68659d9896
|
@ -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");
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue