From 621476424d2b4290ac5832d02ffbf6ea6fae1394 Mon Sep 17 00:00:00 2001 From: ansuz Date: Thu, 29 Dec 2016 17:04:01 +0100 Subject: [PATCH] make strings translatable and refocus on correct input --- www/user/main.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/www/user/main.js b/www/user/main.js index 62d83cbf6..9c04f8864 100644 --- a/www/user/main.js +++ b/www/user/main.js @@ -175,12 +175,14 @@ define([ $confirm.focus(); - // TODO translate APP.register = function () { if ($confirm.val() === passwd) { - return void Cryptpad.alert("registered successfully. Make sure you don't forget your password!", cb); + return void Cryptpad.alert(Cryptpad.Messages.login_registerSuccess, cb); } - Cryptpad.alert("The two passwords you entered do not match. Try again"); + Cryptpad.alert(Cryptpad.Messages.login_passwordMismatch, function (e) { + e.preventDefault(); + window.setTimeout(function () { $confirm.focus(); }, 75); + }); }; };