Przeglądaj źródła

add translation for login form

rajven 3 lat temu
rodzic
commit
e6c9997552

+ 5 - 0
html/inc/languages/english.php

@@ -29,6 +29,8 @@ define("WEB_msg_ERROR","Error!");
 define("WEB_msg_enabled","Enabled");
 define("WEB_msg_disabled","Disabled");
 define("web_msg_login","Login");
+define("WEB_msg_username","Username");
+define("WEB_msg_password","Password");
 define("web_msg_fullname","Full name");
 define("WEB_msg_comment","Comment");
 define("WEB_msg_now","Now");
@@ -41,6 +43,8 @@ define("WEB_msg_unsupported","Not supported");
 define("WEB_msg_delete_filter","Remove Filter");
 define("WEB_msg_add_filter", "Add filter");
 define("WEB_msg_apply_selected","Apply to highlight");
+define("WEB_msg_login_hint","Please enter login");
+define("WEB_msg_password_hint","Please enter your password");
 
 /* SNMP */
 define("WEB_snmp_version","SNMP version");
@@ -229,6 +233,7 @@ define("WEB_btn_show","Show");
 define("WEB_btn_reorder","Apply Order");
 define("WEB_btn_recover","Restore");
 define("WEB_btn_transfom","Transform");
+define("WEB_btn_login","Login");
 
 /* control options */
 define("WEB_config_remove_option","Parameter removed");

+ 6 - 1
html/inc/languages/russian.php

@@ -28,7 +28,9 @@ define("WEB_msg_IP","IP-адрес");
 define("WEB_msg_ERROR","Ошибка!");
 define("WEB_msg_enabled","Включен");
 define("WEB_msg_disabled","Выключен");
-define("WEB_msg_login","Логин");
+define("WEB_msg_login","Вход");
+define("WEB_msg_username","Имя пользователя");
+define("WEB_msg_password","Пароль");
 define("WEB_msg_fullname","ФИО");
 define("WEB_msg_comment","Комментарий");
 define("WEB_msg_now","Сейчас");
@@ -41,6 +43,8 @@ define("WEB_msg_unsupported","Не поддерживается");
 define("WEB_msg_delete_filter","Удалить фильтр");
 define("WEB_msg_add_filter", "Добавить фильтр");
 define("WEB_msg_apply_selected","Применить для выделения");
+define("WEB_msg_login_hint","Введите имя пользователя");
+define("WEB_msg_password_hint","Введите пароль");
 
 /* SNMP */
 define("WEB_snmp_version","SNMP version");
@@ -229,6 +233,7 @@ define("WEB_btn_show","Показать");
 define("WEB_btn_reorder","Применить порядок");
 define("WEB_btn_recover","Восстановить");
 define("WEB_btn_transfom","Преобразовать");
+define("WEB_btn_login","Вход");
 
 /* control options */
 define("WEB_config_remove_option","Удалён параметр");

+ 6 - 6
html/login.php

@@ -12,12 +12,12 @@ if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['submit'])) {
 
     // validate if login is empty
     if (empty($login)) {
-        $error .= '<p class="error">Please enter login.</p>';
+        $error .= '<p class="error">'.WEB_msg_login_hint.'.</p>';
 	}
 
     // validate if password is empty
     if (empty($password)) {
-        $error .= '<p class="error">Please enter your password.</p>';
+        $error .= '<p class="error">'.WEB_msg_password_hint.'.</p>';
 	}
 
     if (empty($error)) {
@@ -38,17 +38,17 @@ if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['submit'])) {
     </head>
     <body>
 	<div class="login">
-	    <h1>Login</h1>
+	    <h1><?php echo WEB_msg_login; ?></h1>
 	    <form action="" method="post">
 		<label for="username">
 		    <i class="fas fa-user"></i>
 		</label>
-		<input type="text" name="login" placeholder="Username" id="login" required>
+		<input type="text" name="login" placeholder="<?php echo WEB_msg_username; ?>" id="login" required>
 		<label for="password">
 		    <i class="fas fa-lock"></i>
 		</label>
-		<input type="password" name="password" placeholder="Password" id="password" required>
-		<input type="submit" name="submit" value="Login">
+		<input type="password" name="password" placeholder="<?php echo WEB_msg_password; ?>" id="password" required>
+		<input type="submit" name="submit" value="<?php echo WEB_btn_login; ?>">
 	    </form>
 	</div>
     </body>