From e109b76b9d10d8b22c7a57789e7117a1069d9d47 Mon Sep 17 00:00:00 2001 From: George Tsiolis Date: Mon, 19 Nov 2018 21:56:01 +0200 Subject: Externalize strings from `/app/views/u2f` --- app/views/u2f/_authenticate.html.haml | 10 +++++----- app/views/u2f/_register.html.haml | 22 +++++++++++----------- 2 files changed, 16 insertions(+), 16 deletions(-) (limited to 'app/views') diff --git a/app/views/u2f/_authenticate.html.haml b/app/views/u2f/_authenticate.html.haml index 1c788b9a737..979f6862de3 100644 --- a/app/views/u2f/_authenticate.html.haml +++ b/app/views/u2f/_authenticate.html.haml @@ -1,18 +1,18 @@ #js-authenticate-u2f -%a.btn.btn-block.btn-info#js-login-2fa-device{ href: '#' } Sign in via 2FA code +%a.btn.btn-block.btn-info#js-login-2fa-device{ href: '#' }= _("Sign in via 2FA code") -# haml-lint:disable InlineJavaScript %script#js-authenticate-u2f-in-progress{ type: "text/template" } - %p Trying to communicate with your device. Plug it in (if you haven't already) and press the button on the device now. + %p= _("Trying to communicate with your device. Plug it in (if you haven't already) and press the button on the device now.") %script#js-authenticate-u2f-error{ type: "text/template" } %div - %p <%= error_message %> (error code: <%= error_code %>) - %a.btn.btn-block.btn-warning#js-u2f-try-again Try again? + %p <%= error_message %> (#{_("error code:")} <%= error_code %>) + %a.btn.btn-block.btn-warning#js-u2f-try-again= _("Try again?") %script#js-authenticate-u2f-authenticated{ type: "text/template" } %div - %p We heard back from your U2F device. You have been authenticated. + %p= _("We heard back from your U2F device. You have been authenticated.") = form_tag(new_user_session_path, method: :post, id: 'js-login-u2f-form') do |f| - resource_params = params[resource_name].presence || params = hidden_field_tag 'user[remember_me]', resource_params.fetch(:remember_me, 0) diff --git a/app/views/u2f/_register.html.haml b/app/views/u2f/_register.html.haml index 39d4d82a77d..f6724f72307 100644 --- a/app/views/u2f/_register.html.haml +++ b/app/views/u2f/_register.html.haml @@ -2,39 +2,39 @@ -# haml-lint:disable InlineJavaScript %script#js-register-u2f-not-supported{ type: "text/template" } - %p Your browser doesn't support U2F. Please use Google Chrome desktop (version 41 or newer). + %p= _("Your browser doesn't support U2F. Please use Google Chrome desktop (version 41 or newer).") %script#js-register-u2f-setup{ type: "text/template" } - if current_user.two_factor_otp_enabled? .row.append-bottom-10 .col-md-4 - %button#js-setup-u2f-device.btn.btn-info.btn-block Set up new U2F device + %button#js-setup-u2f-device.btn.btn-info.btn-block= _("Set up new U2F device") .col-md-8 - %p Your U2F device needs to be set up. Plug it in (if not already) and click the button on the left. + %p= _("Your U2F device needs to be set up. Plug it in (if not already) and click the button on the left.") - else .row.append-bottom-10 .col-md-4 - %button#js-setup-u2f-device.btn.btn-info.btn-block{ disabled: true } Set up new U2F device + %button#js-setup-u2f-device.btn.btn-info.btn-block{ disabled: true }= _("Set up new U2F device") .col-md-8 - %p.text-warning You need to register a two-factor authentication app before you can set up a U2F device. + %p.text-warning= _("You need to register a two-factor authentication app before you can set up a U2F device.") %script#js-register-u2f-in-progress{ type: "text/template" } - %p Trying to communicate with your device. Plug it in (if you haven't already) and press the button on the device now. + %p= _("Trying to communicate with your device. Plug it in (if you haven't already) and press the button on the device now.") %script#js-register-u2f-error{ type: "text/template" } %div %p - %span <%= error_message %> (error code: <%= error_code %>) - %a.btn.btn-warning#js-u2f-try-again Try again? + %span <%= error_message %> (#{_("error code:")} <%= error_code %>) + %a.btn.btn-warning#js-u2f-try-again= _("Try again?") %script#js-register-u2f-registered{ type: "text/template" } .row.append-bottom-10 .col-md-12 - %p Your device was successfully set up! Give it a name and register it with the GitLab server. + %p= _("Your device was successfully set up! Give it a name and register it with the GitLab server.") = form_tag(create_u2f_profile_two_factor_auth_path, method: :post) do .row.append-bottom-10 .col-md-3 - = text_field_tag 'u2f_registration[name]', nil, class: 'form-control', placeholder: "Pick a name" + = text_field_tag 'u2f_registration[name]', nil, class: 'form-control', placeholder: _("Pick a name") .col-md-3 = hidden_field_tag 'u2f_registration[device_response]', nil, class: 'form-control', required: true, id: "js-device-response" - = submit_tag "Register U2F device", class: "btn btn-success" + = submit_tag _("Register U2F device"), class: "btn btn-success" -- cgit v1.2.3