diff --git a/apps/ui/html/login.html b/apps/ui/html/login.html index bc63f13..ea49dbb 100644 --- a/apps/ui/html/login.html +++ b/apps/ui/html/login.html @@ -24,33 +24,33 @@
-
Sign in
-
Welcome back to your workspace
+
Sign in
+
Welcome back to your workspace
-
+
- - + +
- +
- +
@@ -61,13 +61,13 @@ - Google SSO + Google SSO
Crank v0.9.0-beta
diff --git a/apps/ui/js/i18n.js b/apps/ui/js/i18n.js index d699bc5..f883a6e 100644 --- a/apps/ui/js/i18n.js +++ b/apps/ui/js/i18n.js @@ -369,6 +369,16 @@ var TRANSLATIONS = { 'login.password': 'Password', 'login.submit': 'Sign in', 'login.sso': 'Continue with Google', + 'login.email_label': 'Email address', + 'login.email_placeholder': 'you@acme.com', + 'login.forgot': 'Forgot password?', + 'login.divider': 'or continue with', + 'login.sso_short': 'Google SSO', + 'login.request_prefix': "Don't have an account?", + 'login.request_link': 'Request access', + 'login.error.required': 'Please enter your email and password.', + 'login.error.invalid': 'Invalid email or password. Please try again.', + 'login.error.generic': 'Unable to sign in right now. Please try again.', }, ru: { @@ -736,6 +746,16 @@ var TRANSLATIONS = { 'login.password': 'Пароль', 'login.submit': 'Войти', 'login.sso': 'Войти через Google', + 'login.email_label': 'Email адрес', + 'login.email_placeholder': 'you@acme.com', + 'login.forgot': 'Забыли пароль?', + 'login.divider': 'или продолжить через', + 'login.sso_short': 'Google SSO', + 'login.request_prefix': 'Нет аккаунта?', + 'login.request_link': 'Запросить доступ', + 'login.error.required': 'Введите email и пароль.', + 'login.error.invalid': 'Неверный email или пароль. Попробуйте еще раз.', + 'login.error.generic': 'Сейчас не удается войти. Попробуйте еще раз.', } }; diff --git a/apps/ui/js/login.js b/apps/ui/js/login.js index f40b400..91c7144 100644 --- a/apps/ui/js/login.js +++ b/apps/ui/js/login.js @@ -1,4 +1,8 @@ (function() { + function tKey(key) { + return window.t ? t(key) : key; + } + function showError(message) { var errorElement = document.getElementById('login-error'); errorElement.style.display = 'block'; @@ -22,7 +26,7 @@ var password = document.getElementById('password').value; if (!email || !password) { - showError('Please enter your email and password.'); + showError(tKey('login.error.required')); return; } @@ -32,10 +36,10 @@ await window.CrankAuth.login(email, password); } catch (error) { if (error && error.status === 401) { - showError('Invalid email or password. Please try again.'); + showError(tKey('login.error.invalid')); return; } - showError('Unable to sign in right now. Please try again.'); + showError(tKey('login.error.generic')); } }); });