i18n of 2FA login

This commit is contained in:
Carl Chenet 2017-05-17 18:34:19 +02:00
parent 787a82c88b
commit ae60d827c6
4 changed files with 19 additions and 5 deletions

View file

@ -148,7 +148,7 @@ class LoginController < ApplicationController
session.delete(:twofa_u)
return redirect_to "/"
else
flash[:error] = "Your TOTP code did not match. Please try again."
flash[:error] = t('.totpcodenotmatch')
return redirect_to "/login/2fa"
end
end

View file

@ -1,22 +1,22 @@
<div class="box wide">
<div class="legend">
Login - Two Factor Authentication
<%= t('.login2fa') %>
</div>
<%= form_tag twofa_login_url do %>
<p>
Enter the current TOTP code from your TOTP application:
<%= t('.logintotpcode') %>
</p>
<p>
<%= label_tag :totp_code, "TOTP Code:" %>
<%= label_tag :totp_code, t('.totpcode') %>
<%= text_field_tag :totp_code, "", :size => 10, :type => "number",
:autofocus => "autofocus" %>
<br />
</p>
<p>
<%= submit_tag "Login" %>
<%= submit_tag t('.loginbutton') %>
</p>
<% end %>
</div>

View file

@ -174,6 +174,13 @@ en:
password: "New Password:"
again: "(Again):"
setpassbutton: "Set New Password"
twofa:
login2fa: "Login - Two Factor Authentication"
logintotpcode: "Enter the current TOTP code from your TOTP application:"
loginbutton: "Login"
totpcode: "TOTP Code:"
twofa_verify:
totpcodenotmatch: "Your TOTP code did not match. Please try again."
messages:
index:
viewreceived: "View Received"

View file

@ -174,6 +174,13 @@ fr:
password: "Mot de passe :"
again: "(encore):"
setpassbutton: "Changer le mot de passe"
twofa:
login2fa: "Identification par authentification à deux facteurs"
logintotpcode: "Entrez le code TOTP affiché par votre application :"
loginbutton: "S'identifier"
totpcode: "Code TOTP :"
twofa_verify:
totpcodenotmatch: "Code TOTP incorrect. Merci de ré-essayer."
filters:
index:
filteredtags: "Marques filtrées"