]> git.wh0rd.org - tt-rss.git/commitdiff
add lang dropbox on login form
authorAndrew Dolgov <fox@bah.spb.su>
Sat, 11 Aug 2007 13:22:35 +0000 (14:22 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Sat, 11 Aug 2007 13:22:35 +0000 (14:22 +0100)
functions.php
login_form.php

index cd30b45606b345d47af69d00fd97a43a2bf14458..a1ec8fa4b2e8bad703ab049ab509f0c3c6f4e791 100644 (file)
@@ -8,6 +8,16 @@
 
        require_once 'config.php';
 
+       function get_translations() {
+               $translations = array(
+                       "en_US" => __("English"),
+                       "ru_RU" => __("Russian"),
+                       "zh_CN" => __("Chinese"),
+                       "fr_FR" => __("French"));
+
+               return $translations;
+       }
+
        if (ENABLE_TRANSLATIONS == true) { 
                require_once "accept-to-gettext.php";
                require_once "gettext/gettext.inc";
@@ -15,7 +25,7 @@
                function startup_gettext() {
        
                        # Get locale from Accept-Language header
-                       $lang = al2gt(array("en_US", "ru_RU", "zh_CN", "fr_FR"), "text/html");
+                       $lang = al2gt(array(array_keys(get_translations())), "text/html");
 
                        if (defined('_TRANSLATION_OVERRIDE_DEFAULT')) {
                                $lang = _TRANSLATION_OVERRIDE_DEFAULT;
index 55ad4b1a1d88d7130e3bc83a3e58f3e7f1220201..40e746157d85bebedf2c836a6e4733fdfac3531e 100644 (file)
@@ -50,6 +50,12 @@ window.onload = init;
                        <td align="right"><input name="login"></td></tr>
                        <tr><td align="right"><?php echo __("Password:") ?></td>
                        <td align="right"><input type="password" name="password"></td></tr>
+                       <tr><td align="right"><?php echo __("Language:") ?></td>
+                       <td align="right">
+                       <?php
+                               print_select_hash("language", "", get_translations());  
+                       ?>
+                       </td></tr>
                        <!-- <tr><td colspan="2">
                                <input type="checkbox" name="remember_me" id="remember_me">
                                <label for="remember_me">Remember me on this computer</label>