From f72d4a7e9b218ddad1f8bc9d4383c7b9f96afa35 Mon Sep 17 00:00:00 2001 From: Tao Wang Date: Tue, 12 Jun 2018 19:29:49 +1000 Subject: [PATCH] i18n: externalize strings from 'app/views/devise' Signed-off-by: Tao Wang --- .../devise/confirmations/almost_there.haml | 8 +- app/views/devise/confirmations/new.html.haml | 4 +- ...onfirmation_instructions_account.html.haml | 12 +- ...confirmation_instructions_account.text.erb | 8 +- ...firmation_instructions_secondary.html.haml | 11 +- ...nfirmation_instructions_secondary.text.erb | 6 +- .../devise/mailer/password_change.html.haml | 10 +- .../devise/mailer/password_change.text.erb | 8 +- .../reset_password_instructions.html.haml | 13 +- .../reset_password_instructions.text.erb | 9 +- .../mailer/unlock_instructions.html.haml | 8 +- .../mailer/unlock_instructions.text.erb | 6 +- app/views/devise/passwords/edit.html.haml | 17 +- app/views/devise/passwords/new.html.haml | 6 +- app/views/devise/registrations/edit.html.erb | 12 +- app/views/devise/registrations/new.html.haml | 2 +- app/views/devise/sessions/_new_base.html.haml | 13 +- .../devise/sessions/_new_crowd.html.haml | 11 +- app/views/devise/sessions/_new_ldap.html.haml | 9 +- app/views/devise/sessions/new.html.haml | 4 +- .../devise/sessions/two_factor.html.haml | 11 +- app/views/devise/shared/_links.erb | 10 +- .../devise/shared/_omniauth_box.html.haml | 4 +- .../devise/shared/_sign_in_link.html.haml | 4 +- app/views/devise/shared/_signup_box.html.haml | 30 +-- app/views/devise/shared/_tabs_ldap.html.haml | 8 +- app/views/devise/unlocks/new.html.haml | 6 +- locale/gitlab.pot | 210 ++++++++++++++++++ qa/qa/page/main/login.rb | 8 +- qa/qa/page/main/sign_up.rb | 2 +- 30 files changed, 341 insertions(+), 129 deletions(-) diff --git a/app/views/devise/confirmations/almost_there.haml b/app/views/devise/confirmations/almost_there.haml index 79826a364db3a2..2a4cc24e313820 100644 --- a/app/views/devise/confirmations/almost_there.haml +++ b/app/views/devise/confirmations/almost_there.haml @@ -1,14 +1,14 @@ .well-confirmation.text-center.append-bottom-20 %h1.prepend-top-0 - Almost there... + = _('Almost there...') %p.lead.append-bottom-20 - Please check your email to confirm your account + = _('Please check your email to confirm your account') %hr - if Gitlab::CurrentSettings.after_sign_up_text.present? .well-confirmation.text-center = markdown_field(Gitlab::CurrentSettings, :after_sign_up_text) %p.text-center - No confirmation email received? Please check your spam folder or + = _('No confirmation email received? Please check your spam folder or') .append-bottom-20.prepend-top-20.text-center %a.btn.btn-lg.btn-success{ href: new_user_confirmation_path } - Request new confirmation email + = _('Request new confirmation email') diff --git a/app/views/devise/confirmations/new.html.haml b/app/views/devise/confirmations/new.html.haml index 73e70dc63e5635..ae8095b3a1809c 100644 --- a/app/views/devise/confirmations/new.html.haml +++ b/app/views/devise/confirmations/new.html.haml @@ -6,9 +6,9 @@ = devise_error_messages! .form-group = f.label :email - = f.email_field :email, class: "form-control", required: true, title: 'Please provide a valid email address.' + = f.email_field :email, class: "form-control", required: true, title: _('Please provide a valid email address.') .clearfix - = f.submit "Resend", class: 'btn btn-success' + = f.submit _("Resend"), class: 'btn btn-success' .clearfix.prepend-top-20 = render 'devise/shared/sign_in_link' diff --git a/app/views/devise/mailer/_confirmation_instructions_account.html.haml b/app/views/devise/mailer/_confirmation_instructions_account.html.haml index 65565b7b8a84f9..f555b5c5303361 100644 --- a/app/views/devise/mailer/_confirmation_instructions_account.html.haml +++ b/app/views/devise/mailer/_confirmation_instructions_account.html.haml @@ -2,15 +2,15 @@ - if @resource.unconfirmed_email.present? #content = email_default_heading(@resource.unconfirmed_email) - %p Click the link below to confirm your email address. + %p= _('Click the link below to confirm your email address.') #cta - = link_to 'Confirm your email address', confirmation_link + = link_to _('Confirm your email address'), confirmation_link - else #content - if Gitlab.com? - = email_default_heading('Thanks for signing up to GitLab!') + = email_default_heading(_('Thanks for signing up to GitLab!')) - else - = email_default_heading("Welcome, #{@resource.name}!") - %p To get started, click the link below to confirm your account. + = email_default_heading(_("Welcome, %{name}!") % { name: @resource.name }) + %p= _("To get started, click the link below to confirm your account.") #cta - = link_to 'Confirm your account', confirmation_link + = link_to _('Confirm your account'), confirmation_link diff --git a/app/views/devise/mailer/_confirmation_instructions_account.text.erb b/app/views/devise/mailer/_confirmation_instructions_account.text.erb index 01f09aa763da5c..9347d6bc18bc04 100644 --- a/app/views/devise/mailer/_confirmation_instructions_account.text.erb +++ b/app/views/devise/mailer/_confirmation_instructions_account.text.erb @@ -1,14 +1,14 @@ <% if @resource.unconfirmed_email.present? %> <%= @resource.unconfirmed_email %>, -Use the link below to confirm your email address. +<%= _('Use the link below to confirm your email address.') %> <% else %> <% if Gitlab.com? %> -Thanks for signing up to GitLab! +<%= _('Thanks for signing up to GitLab!') %> <% else %> -Welcome, <%= @resource.name %>! +<%= _("Welcome, %{name}!") % { name: @resource.name } %> <% end %> -To get started, use the link below to confirm your account. +<%= _('To get started, use the link below to confirm your account.') %> <% end %> <%= confirmation_url(@resource, confirmation_token: @token) %> diff --git a/app/views/devise/mailer/_confirmation_instructions_secondary.html.haml b/app/views/devise/mailer/_confirmation_instructions_secondary.html.haml index 3d0a1f622a53e6..f82502b7ec5521 100644 --- a/app/views/devise/mailer/_confirmation_instructions_secondary.html.haml +++ b/app/views/devise/mailer/_confirmation_instructions_secondary.html.haml @@ -1,8 +1,9 @@ #content - = email_default_heading("#{@resource.user.name}, you've added an additional email!") - %p Click the link below to confirm your email address (#{@resource.email}) + = email_default_heading(_("%{name}, you've added an additional email!") % { name: @resource.user.name }) + %p + = _('Click the link below to confirm your email address (%{email})') % { email: @resource.email } #cta - = link_to 'Confirm your email address', confirmation_url(@resource, confirmation_token: @token) + = link_to _('Confirm your email address'), confirmation_url(@resource, confirmation_token: @token) %p - If this email was added in error, you can remove it here: - = link_to "Emails", profile_emails_url + = _('If this email was added in error, you can remove it here:') + = link_to _("Emails"), profile_emails_url diff --git a/app/views/devise/mailer/_confirmation_instructions_secondary.text.erb b/app/views/devise/mailer/_confirmation_instructions_secondary.text.erb index a3b28cb0b84dd8..529d29fef31852 100644 --- a/app/views/devise/mailer/_confirmation_instructions_secondary.text.erb +++ b/app/views/devise/mailer/_confirmation_instructions_secondary.text.erb @@ -1,7 +1,7 @@ -<%= @resource.user.name %>, you've added an additional email! +<%= _("%{name}, you've added an additional email!") % { name: @resource.user.name } %> -Use the link below to confirm your email address (<%= @resource.email %>) +<%= _("Use the link below to confirm your email address (%{email})") % { email: @resource.email } %> <%= confirmation_url(@resource, confirmation_token: @token) %> -If this email was added in error, you can remove it here: <%= profile_emails_url %> +<%= _("If this email was added in error, you can remove it here: %{profile_emails_url}") % { profile_emails_url: profile_emails_url } %> diff --git a/app/views/devise/mailer/password_change.html.haml b/app/views/devise/mailer/password_change.html.haml index 5ec515285f2185..06cdc812645d02 100644 --- a/app/views/devise/mailer/password_change.html.haml +++ b/app/views/devise/mailer/password_change.html.haml @@ -1,8 +1,6 @@ -= email_default_heading("Hello, #{@resource.name}!") += email_default_heading(_("Hello, %{name}!") % { name: @resource.name }) %p - The password for your GitLab account on - #{link_to(Gitlab.config.gitlab.url, Gitlab.config.gitlab.url)} - has successfully been changed. + = _('The password for your GitLab account on %{link_to_gitlab} has successfully been changed.').html_safe % { link_to_gitlab: link_to(Gitlab.config.gitlab.url, Gitlab.config.gitlab.url) } + %p - If you did not initiate this change, please contact your administrator - immediately. + = _('If you did not initiate this change, please contact your administrator immediately.') diff --git a/app/views/devise/mailer/password_change.text.erb b/app/views/devise/mailer/password_change.text.erb index 95923d9f8de566..6a8128186f59eb 100644 --- a/app/views/devise/mailer/password_change.text.erb +++ b/app/views/devise/mailer/password_change.text.erb @@ -1,7 +1,5 @@ -Hello, <%= @resource.name %>! +<%= _('Hello, %{name}!') % { name: @resource.name } %> -The password for your GitLab account on <%= Gitlab.config.gitlab.url %> -has successfully been changed. +<%= _('The password for your GitLab account on %{gitlab_url} has successfully been changed.') % { gitlab_url: Gitlab.config.gitlab.url } %> -If you did not initiate this change, please contact your administrator -immediately. +<%= _('If you did not initiate this change, please contact your administrator immediately.') %> diff --git a/app/views/devise/mailer/reset_password_instructions.html.haml b/app/views/devise/mailer/reset_password_instructions.html.haml index 47e192afa52881..688a95c774b796 100644 --- a/app/views/devise/mailer/reset_password_instructions.html.haml +++ b/app/views/devise/mailer/reset_password_instructions.html.haml @@ -1,10 +1,11 @@ -= email_default_heading("Hello, #{@resource.name}!") += email_default_heading(_("Hello, %{name}!") % { name: @resource.name }) %p - Someone, hopefully you, has requested to reset the password for your - GitLab account on #{link_to(Gitlab.config.gitlab.url, Gitlab.config.gitlab.url)}. + - link_to_gitlab = link_to(Gitlab.config.gitlab.url, Gitlab.config.gitlab.url) + = _('Someone, hopefully you, has requested to reset the password for your GitLab account on %{link_to_gitlab}.').html_safe % { link_to_gitlab: link_to_gitlab } + %p - If you did not perform this request, you can safely ignore this email. + = _('If you did not perform this request, you can safely ignore this email.') %p - Otherwise, click the link below to complete the process. + = _('Otherwise, click the link below to complete the process.') #cta - = link_to('Reset password', edit_password_url(@resource, reset_password_token: @token)) + = link_to(_('Reset password'), edit_password_url(@resource, reset_password_token: @token)) diff --git a/app/views/devise/mailer/reset_password_instructions.text.erb b/app/views/devise/mailer/reset_password_instructions.text.erb index 116313ee11c57c..cc31760ffc3f5d 100644 --- a/app/views/devise/mailer/reset_password_instructions.text.erb +++ b/app/views/devise/mailer/reset_password_instructions.text.erb @@ -1,10 +1,9 @@ -Hello, <%= @resource.name %>! +<%= _("Hello, %{name}!") % { name: @resource.name } %> -Someone, hopefully you, has requested to reset the password for your GitLab -account on <%= Gitlab.config.gitlab.url %> +<%= _("Someone, hopefully you, has requested to reset the password for your GitLab account on %{gitlab_url}") % { gitlab_url: Gitlab.config.gitlab.url } %> -If you did not perform this request, you can safely ignore this email. +<%= _("If you did not perform this request, you can safely ignore this email.") %> -Otherwise, click the link below to complete the process: +<%= _("Otherwise, click the link below to complete the process:") %> <%= edit_password_url(@resource, reset_password_token: @token) %> diff --git a/app/views/devise/mailer/unlock_instructions.html.haml b/app/views/devise/mailer/unlock_instructions.html.haml index 8ddfd3ea74a931..0c05ee4a6cd703 100644 --- a/app/views/devise/mailer/unlock_instructions.html.haml +++ b/app/views/devise/mailer/unlock_instructions.html.haml @@ -1,8 +1,6 @@ #content - = email_default_heading("Hello, #{@resource.name}!") + = email_default_heading(_("Hello, %{name}!") % { name: @resource.name }) %p - Your GitLab account has been locked due to an excessive amount of unsuccessful - sign in attempts. Your account will automatically unlock in #{distance_of_time_in_words(Devise.unlock_in)} - or you may click the link below to unlock now. + = _("Your GitLab account has been locked due to an excessive amount of unsuccessful sign in attempts. Your account will automatically unlock in %{duration} or you may click the link below to unlock now.") % { duration: distance_of_time_in_words(Devise.unlock_in) } #cta - = link_to('Unlock account', unlock_url(@resource, unlock_token: @token)) + = link_to(_('Unlock account'), unlock_url(@resource, unlock_token: @token)) diff --git a/app/views/devise/mailer/unlock_instructions.text.erb b/app/views/devise/mailer/unlock_instructions.text.erb index 8d4abbf35000ea..9b1e2166ceeea6 100644 --- a/app/views/devise/mailer/unlock_instructions.text.erb +++ b/app/views/devise/mailer/unlock_instructions.text.erb @@ -1,7 +1,5 @@ -Hello, <%= @resource.name %>! +<%= _('Hello, %{name}!') % { name: @resource.name } %> -Your GitLab account has been locked due to an excessive amount of unsuccessful -sign in attempts. Your account will automatically unlock in <%= distance_of_time_in_words(Devise.unlock_in) %> -or you may click the link below to unlock now. +<%= _("Your GitLab account has been locked due to an excessive amount of unsuccessful sign in attempts. Your account will automatically unlock in %{duration} or you may click the link below to unlock now.") % { duration: distance_of_time_in_words(Devise.unlock_in) } %> <%= unlock_url(@resource, unlock_token: @token) %> diff --git a/app/views/devise/passwords/edit.html.haml b/app/views/devise/passwords/edit.html.haml index 35dafb3e980dbe..5e22f63aa31073 100644 --- a/app/views/devise/passwords/edit.html.haml +++ b/app/views/devise/passwords/edit.html.haml @@ -1,4 +1,4 @@ -= render 'devise/shared/tab_single', tab_title:'Change your password' += render 'devise/shared/tab_single', tab_title: _('Change your password') .login-box .login-body = form_for(resource, as: resource_name, url: password_path(:user), html: { method: :put, class: 'gl-show-field-errors' }) do |f| @@ -6,16 +6,17 @@ = devise_error_messages! = f.hidden_field :reset_password_token .form-group - = f.label 'New password', for: "user_password" - = f.password_field :password, class: "form-control top", required: true, title: 'This field is required' + = f.label _('New password'), for: "user_password" + = f.password_field :password, class: "form-control top", required: true, title: _('This field is required') .form-group - = f.label 'Confirm new password', for: "user_password_confirmation" - = f.password_field :password_confirmation, class: "form-control bottom", title: 'This field is required', required: true + = f.label _('Confirm new password'), for: "user_password_confirmation" + = f.password_field :password_confirmation, class: "form-control bottom", title: _('This field is required'), required: true .clearfix - = f.submit "Change your password", class: "btn btn-primary" + = f.submit _("Change your password"), class: "btn btn-primary" .clearfix.prepend-top-20 %p - %span.light Didn't receive a confirmation email? - = link_to "Request a new one", new_confirmation_path(:user) + %span.light + = _("Didn't receive a confirmation email?") + = link_to _("Request a new one"), new_confirmation_path(:user) = render 'devise/shared/sign_in_link' diff --git a/app/views/devise/passwords/new.html.haml b/app/views/devise/passwords/new.html.haml index 99ce13adf7408f..449b5cd561c406 100644 --- a/app/views/devise/passwords/new.html.haml +++ b/app/views/devise/passwords/new.html.haml @@ -1,4 +1,4 @@ -= render 'devise/shared/tab_single', tab_title: 'Reset Password' += render 'devise/shared/tab_single', tab_title: _('Reset Password') .login-box .login-body = form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post, class: 'gl-show-field-errors' }) do |f| @@ -6,9 +6,9 @@ = devise_error_messages! .form-group = f.label :email - = f.email_field :email, class: "form-control", required: true, value: params[:user_email], autofocus: true, title: 'Please provide a valid email address.' + = f.email_field :email, class: "form-control", required: true, value: params[:user_email], autofocus: true, title: _('Please provide a valid email address.') .clearfix - = f.submit "Reset password", class: "btn-primary btn" + = f.submit _("Reset password"), class: "btn-primary btn" .clearfix.prepend-top-20 = render 'devise/shared/sign_in_link' diff --git a/app/views/devise/registrations/edit.html.erb b/app/views/devise/registrations/edit.html.erb index f379e71ae5b444..2116aa6883d519 100644 --- a/app/views/devise/registrations/edit.html.erb +++ b/app/views/devise/registrations/edit.html.erb @@ -9,20 +9,20 @@
<%= f.label :name %>
<%= f.text_field :name %>
-
<%= f.label :password %> (leave blank if you don't want to change it)
+
<%= f.label :password %> <%= _("(leave blank if you don't want to change it)") %>
<%= f.password_field :password %>
<%= f.label :password_confirmation %>
<%= f.password_field :password_confirmation %>
-
<%= f.label :current_password %> (we need your current password to confirm your changes)
+
<%= f.label :current_password %> <%= _("(we need your current password to confirm your changes)") %>
<%= f.password_field :current_password %>
-
<%= f.submit "Update", class: "input_button" %>
+
<%= f.submit _("Update"), class: "input_button" %>
<% end %> -

Cancel your account

+

<%= _('Cancel your account') %>

-

Unhappy? <%= link_to "Cancel your account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete %>.

+

<%= _('Unhappy?') %> <%= link_to _("Cancel your account"), registration_path(resource_name), data: { confirm: _("Are you sure?") }, method: :delete %>.

-<%= link_to "Back", :back %> +<%= link_to _("Back"), :back %> diff --git a/app/views/devise/registrations/new.html.haml b/app/views/devise/registrations/new.html.haml index 42cfbbf84f2b73..ad6c52e29b8715 100644 --- a/app/views/devise/registrations/new.html.haml +++ b/app/views/devise/registrations/new.html.haml @@ -1,4 +1,4 @@ -- page_title "Sign up" +- page_title _("Sign up") = render 'devise/shared/signup_box' = render 'devise/shared/sign_in_link' diff --git a/app/views/devise/sessions/_new_base.html.haml b/app/views/devise/sessions/_new_base.html.haml index 0ee563ac0664ff..a8c931c37fc744 100644 --- a/app/views/devise/sessions/_new_base.html.haml +++ b/app/views/devise/sessions/_new_base.html.haml @@ -1,20 +1,21 @@ = form_for(resource, as: resource_name, url: session_path(resource_name), html: { class: 'new_user gl-show-field-errors', 'aria-live' => 'assertive'}) do |f| .form-group - = f.label "Username or email", for: "user_login" - = f.text_field :login, class: "form-control top", autofocus: "autofocus", autocapitalize: "off", autocorrect: "off", required: true, title: "This field is required." + = f.label _("Username or email"), for: "user_login" + = f.text_field :login, class: "form-control top", autofocus: "autofocus", autocapitalize: "off", autocorrect: "off", required: true, title: _("This field is required.") .form-group = f.label :password - = f.password_field :password, class: "form-control bottom", required: true, title: "This field is required." + = f.password_field :password, class: "form-control bottom", required: true, title: _("This field is required.") - if devise_mapping.rememberable? .remember-me %label{ for: "user_remember_me" } = f.check_box :remember_me, class: 'remember-me-checkbox' - %span Remember me + %span + = _('Remember me') .float-right.forgot-password - = link_to "Forgot your password?", new_password_path(:user) + = link_to _("Forgot your password?"), new_password_path(:user) %div - if captcha_enabled? = recaptcha_tags .submit-container.move-submit-down - = f.submit "Sign in", class: "btn btn-save" + = f.submit _("Sign in"), class: "btn btn-save" diff --git a/app/views/devise/sessions/_new_crowd.html.haml b/app/views/devise/sessions/_new_crowd.html.haml index 36ff42090be376..787040b01c16cc 100644 --- a/app/views/devise/sessions/_new_crowd.html.haml +++ b/app/views/devise/sessions/_new_crowd.html.haml @@ -1,13 +1,14 @@ = form_tag(omniauth_authorize_path(:user, :crowd), id: 'new_crowd_user', class: 'gl-show-field-errors') do .form-group - = label_tag :username, 'Username or email' - = text_field_tag :username, nil, { class: "form-control top", title: "This field is required", autofocus: "autofocus", required: true } + = label_tag :username, _('Username or email') + = text_field_tag :username, nil, { class: "form-control top", title: _("This field is required"), autofocus: "autofocus", required: true } .form-group = label_tag :password - = password_field_tag :password, nil, { class: "form-control bottom", title: "This field is required.", required: true } + = password_field_tag :password, nil, { class: "form-control bottom", title: _("This field is required."), required: true } - if devise_mapping.rememberable? .remember-me %label{ for: "remember_me" } = check_box_tag :remember_me, '1', false, id: 'remember_me' - %span Remember me - = submit_tag "Sign in", class: "btn-save btn" + %span + = _('Remember me') + = submit_tag _("Sign in"), class: "btn-save btn" diff --git a/app/views/devise/sessions/_new_ldap.html.haml b/app/views/devise/sessions/_new_ldap.html.haml index 6bf7349f6025b4..e1e880e1fbe6b4 100644 --- a/app/views/devise/sessions/_new_ldap.html.haml +++ b/app/views/devise/sessions/_new_ldap.html.haml @@ -1,13 +1,14 @@ = form_tag(omniauth_callback_path(:user, server['provider_name']), id: 'new_ldap_user', class: "gl-show-field-errors") do .form-group = label_tag :username, "#{server['label']} Username" - = text_field_tag :username, nil, { class: "form-control top", title: "This field is required.", autofocus: "autofocus", required: true } + = text_field_tag :username, nil, { class: "form-control top", title: _("This field is required."), autofocus: "autofocus", required: true } .form-group = label_tag :password - = password_field_tag :password, nil, { class: "form-control bottom", title: "This field is required.", required: true } + = password_field_tag :password, nil, { class: "form-control bottom", title: _("This field is required."), required: true } - if devise_mapping.rememberable? .remember-me %label{ for: "remember_me" } = check_box_tag :remember_me, '1', false, id: 'remember_me' - %span Remember me - = submit_tag "Sign in", class: "btn-save btn" + %span + = _('Remember me') + = submit_tag _("Sign in"), class: "btn-save btn" diff --git a/app/views/devise/sessions/new.html.haml b/app/views/devise/sessions/new.html.haml index 34d4293bd45c31..0f21613ee3784d 100644 --- a/app/views/devise/sessions/new.html.haml +++ b/app/views/devise/sessions/new.html.haml @@ -1,4 +1,4 @@ -- page_title "Sign in" +- page_title _("Sign in") %div - if form_based_providers.any? @@ -16,7 +16,7 @@ -# Show a message if none of the mechanisms above are enabled - if !password_authentication_enabled_for_web? && !ldap_enabled? && !(omniauth_enabled? && devise_mapping.omniauthable?) %div - No authentication methods configured. + = _('No authentication methods configured.') - if omniauth_enabled? && devise_mapping.omniauthable? && button_based_providers_enabled? .clearfix diff --git a/app/views/devise/sessions/two_factor.html.haml b/app/views/devise/sessions/two_factor.html.haml index ba168c4eab8d2a..4b278cbbbf7193 100644 --- a/app/views/devise/sessions/two_factor.html.haml +++ b/app/views/devise/sessions/two_factor.html.haml @@ -1,5 +1,5 @@ %div - = render 'devise/shared/tab_single', tab_title: 'Two-Factor Authentication' + = render 'devise/shared/tab_single', tab_title: _('Two-Factor Authentication') .login-box .login-body - if @user.two_factor_otp_enabled? @@ -7,11 +7,12 @@ - resource_params = params[resource_name].presence || params = f.hidden_field :remember_me, value: resource_params.fetch(:remember_me, 0) %div - = f.label 'Two-Factor Authentication code', name: :otp_attempt - = f.text_field :otp_attempt, class: 'form-control', required: true, autofocus: true, autocomplete: 'off', title: 'This field is required.' - %p.form-text.text-muted.hint Enter the code from the two-factor app on your mobile device. If you've lost your device, you may enter one of your recovery codes. + = f.label _('Two-Factor Authentication code'), name: :otp_attempt + = f.text_field :otp_attempt, class: 'form-control', required: true, autofocus: true, autocomplete: 'off', title: _('This field is required.') + %p.form-text.text-muted.hint + = _("Enter the code from the two-factor app on your mobile device. If you've lost your device, you may enter one of your recovery codes.") .prepend-top-20 - = f.submit "Verify code", class: "btn btn-save" + = f.submit _("Verify code"), class: "btn btn-save" - if @user.two_factor_u2f_enabled? = render "u2f/authenticate", locals: { params: params, resource: resource, resource_name: resource_name } diff --git a/app/views/devise/shared/_links.erb b/app/views/devise/shared/_links.erb index cb934434c28239..f0215f5ea42964 100644 --- a/app/views/devise/shared/_links.erb +++ b/app/views/devise/shared/_links.erb @@ -1,19 +1,19 @@ <%- if controller_name != 'sessions' %> - <%= link_to "Sign in", new_session_path(:user, redirect_to_referer: 'yes'), class: "btn" %>
+ <%= link_to _("Sign in"), new_session_path(:user, redirect_to_referer: 'yes'), class: "btn" %>
<% end -%> <%- if devise_mapping.registerable? && controller_name != 'registrations' && allow_signup? %> - <%= link_to "Sign up", new_registration_path(:user) %>
+ <%= link_to _("Sign up"), new_registration_path(:user) %>
<% end -%> <%- if devise_mapping.recoverable? && controller_name != 'passwords' %> -<%= link_to "Forgot your password?", new_password_path(:user), class: "btn" %>
+<%= link_to _("Forgot your password?"), new_password_path(:user), class: "btn" %>
<% end -%> <%- if devise_mapping.confirmable? && controller_name != 'confirmations' %> - <%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(:user) %>
+ <%= link_to _("Didn't receive confirmation instructions?"), new_confirmation_path(:user) %>
<% end -%> <%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %> - <%= link_to "Didn't receive unlock instructions?", new_unlock_path(:user) %>
+ <%= link_to _("Didn't receive unlock instructions?"), new_unlock_path(:user) %>
<% end -%> diff --git a/app/views/devise/shared/_omniauth_box.html.haml b/app/views/devise/shared/_omniauth_box.html.haml index 3723814debe33a..bc7ee25f18f435 100644 --- a/app/views/devise/shared/_omniauth_box.html.haml +++ b/app/views/devise/shared/_omniauth_box.html.haml @@ -1,7 +1,7 @@ .omniauth-container %p %span.light - Sign in with   + = _('Sign in with  ') - providers = enabled_button_based_providers - providers.each do |provider| %span.light @@ -11,4 +11,4 @@ %label = check_box_tag :remember_me, nil, false, class: 'remember-me-checkbox' %span - Remember me + = _('Remember me') diff --git a/app/views/devise/shared/_sign_in_link.html.haml b/app/views/devise/shared/_sign_in_link.html.haml index 77ef103cc47b6f..2f72f4f40d1dd0 100644 --- a/app/views/devise/shared/_sign_in_link.html.haml +++ b/app/views/devise/shared/_sign_in_link.html.haml @@ -1,4 +1,4 @@ %p %span.light - Already have login and password? - = link_to "Sign in", new_session_path(:user, redirect_to_referer: 'yes') + = _('Already have login and password?') + = link_to _("Sign in"), new_session_path(:user, redirect_to_referer: 'yes') diff --git a/app/views/devise/shared/_signup_box.html.haml b/app/views/devise/shared/_signup_box.html.haml index 7c4dcaa2962a1d..8fbceff1111cee 100644 --- a/app/views/devise/shared/_signup_box.html.haml +++ b/app/views/devise/shared/_signup_box.html.haml @@ -4,24 +4,27 @@ .devise-errors = devise_error_messages! .form-group - = f.label :name, 'Full name' - = f.text_field :name, class: "form-control top", required: true, title: "This field is required." + = f.label :name, _('Full name') + = f.text_field :name, class: "form-control top", required: true, title: _("This field is required.") .username.form-group = f.label :username - = f.text_field :username, class: "form-control middle", pattern: Gitlab::PathRegex::NAMESPACE_FORMAT_REGEX_JS, required: true, title: 'Please create a username with only alphanumeric characters.' - %p.validation-error.hide Username is already taken. - %p.validation-success.hide Username is available. - %p.validation-pending.hide Checking username availability... + = f.text_field :username, class: "form-control middle", pattern: Gitlab::PathRegex::NAMESPACE_FORMAT_REGEX_JS, required: true, title: _('Please create a username with only alphanumeric characters.') + %p.validation-error.hide + = _('Username is already taken.') + %p.validation-success.hide + = _('Username is available.') + %p.validation-pending.hide + = _('Checking username availability...') .form-group = f.label :email - = f.email_field :email, class: "form-control middle", required: true, title: "Please provide a valid email address." + = f.email_field :email, class: "form-control middle", required: true, title: _("Please provide a valid email address.") .form-group = f.label :email_confirmation - = f.email_field :email_confirmation, class: "form-control middle", required: true, title: "Please retype the email address." + = f.email_field :email_confirmation, class: "form-control middle", required: true, title: _("Please retype the email address.") .form-group.append-bottom-20#password-strength = f.label :password - = f.password_field :password, class: "form-control bottom", required: true, pattern: ".{#{@minimum_password_length},}", title: "Minimum length is #{@minimum_password_length} characters." - %p.gl-field-hint Minimum length is #{@minimum_password_length} characters + = f.password_field :password, class: "form-control bottom", required: true, pattern: ".{#{@minimum_password_length},}", title: _("Minimum length is %{minimum_password_length} characters.") % { minimum_password_length: @minimum_password_length } + %p.gl-field-hint= _("Minimum length is %{minimum_password_length} characters") % { minimum_password_length: @minimum_password_length } - if Gitlab::CurrentSettings.current_application_settings.enforce_terms? .form-group = check_box_tag :terms_opt_in, '1', false, required: true @@ -34,9 +37,10 @@ - if Gitlab::Recaptcha.enabled? = recaptcha_tags .submit-container - = f.submit "Register", class: "btn-register btn" + = f.submit _("Register"), class: "btn-register btn" .clearfix.submit-container %p - %span.light Didn't receive a confirmation email? + %span.light + = _("Didn't receive a confirmation email?") = succeed '.' do - = link_to "Request a new one", new_confirmation_path(:user) + = link_to _("Request a new one"), new_confirmation_path(:user) diff --git a/app/views/devise/shared/_tabs_ldap.html.haml b/app/views/devise/shared/_tabs_ldap.html.haml index fbf35da10967b5..d29575e2b838e0 100644 --- a/app/views/devise/shared/_tabs_ldap.html.haml +++ b/app/views/devise/shared/_tabs_ldap.html.haml @@ -1,16 +1,16 @@ %ul.nav-links.new-session-tabs.nav-tabs.nav{ class: ('custom-provider-tabs' if form_based_providers.any?) } - if crowd_enabled? %li.nav-item - = link_to "Crowd", "#crowd", class: 'nav-link active', 'data-toggle' => 'tab' + = link_to _("Crowd"), "#crowd", class: 'nav-link active', 'data-toggle' => 'tab' - if kerberos_enabled? %li.nav-item - = link_to "Kerberos", "#kerberos", class: "nav-link #{active_when(!crowd_enabled? && !ldap_enabled?)}", 'data-toggle' => 'tab' + = link_to _("Kerberos"), "#kerberos", class: "nav-link #{active_when(!crowd_enabled? && !ldap_enabled?)}", 'data-toggle' => 'tab' - @ldap_servers.each_with_index do |server, i| %li.nav-item = link_to server['label'], "##{server['provider_name']}", class: "nav-link #{active_when(i.zero? && !crowd_enabled?)}", 'data-toggle' => 'tab' - if password_authentication_enabled_for_web? %li.nav-item - = link_to 'Standard', '#login-pane', class: 'nav-link', 'data-toggle' => 'tab' + = link_to _('Standard'), '#login-pane', class: 'nav-link', 'data-toggle' => 'tab' - if allow_signup? %li.nav-item - = link_to 'Register', '#register-pane', class: 'nav-link', 'data-toggle' => 'tab' + = link_to _('Register'), '#register-pane', class: 'nav-link', 'data-toggle' => 'tab' diff --git a/app/views/devise/unlocks/new.html.haml b/app/views/devise/unlocks/new.html.haml index b2f48a4e0bf252..08fb89429abad3 100644 --- a/app/views/devise/unlocks/new.html.haml +++ b/app/views/devise/unlocks/new.html.haml @@ -1,4 +1,4 @@ -= render 'devise/shared/tab_single', tab_title: 'Resend unlock instructions' += render 'devise/shared/tab_single', tab_title: _('Resend unlock instructions') .login-box .login-body = form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post, class: 'gl-show-field-errors' }) do |f| @@ -6,9 +6,9 @@ = devise_error_messages! .form-group.append-bottom-20 = f.label :email - = f.email_field :email, class: 'form-control', autofocus: 'autofocus', autocapitalize: 'off', autocorrect: 'off', title: 'Please provide a valid email address.' + = f.email_field :email, class: 'form-control', autofocus: 'autofocus', autocapitalize: 'off', autocorrect: 'off', title: _('Please provide a valid email address.') .clearfix - = f.submit 'Resend unlock instructions', class: 'btn btn-success' + = f.submit _('Resend unlock instructions'), class: 'btn btn-success' .clearfix.prepend-top-20 = render 'devise/shared/sign_in_link' diff --git a/locale/gitlab.pot b/locale/gitlab.pot index 0ea8789d6cbfc5..3b62465a18883f 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -131,6 +131,9 @@ msgstr "" msgid "%{name}'s avatar" msgstr "" +msgid "%{name}, you've added an additional email!" +msgstr "" + msgid "%{nip_domain} can be used as an alternative to a custom domain." msgstr "" @@ -188,6 +191,12 @@ msgstr[1] "" msgid "%{unstaged} unstaged and %{staged} staged changes" msgstr "" +msgid "(leave blank if you don't want to change it)" +msgstr "" + +msgid "(we need your current password to confirm your changes)" +msgstr "" + msgid "+ %{moreCount} more" msgstr "" @@ -525,6 +534,12 @@ msgstr "" msgid "Allows you to add and manage Kubernetes clusters." msgstr "" +msgid "Almost there..." +msgstr "" + +msgid "Already have login and password?" +msgstr "" + msgid "Also called \"Issuer\" or \"Relying party trust identifier\"" msgstr "" @@ -885,6 +900,9 @@ msgstr "" msgid "Average per day: %{average}" msgstr "" +msgid "Back" +msgstr "" + msgid "Background Color" msgstr "" @@ -1301,6 +1319,9 @@ msgstr "" msgid "Cancel this job" msgstr "" +msgid "Cancel your account" +msgstr "" + msgid "Cannot be merged automatically" msgstr "" @@ -1319,6 +1340,9 @@ msgstr "" msgid "Change this value to influence how frequently the GitLab UI polls for updates." msgstr "" +msgid "Change your password" +msgstr "" + msgid "ChangeTypeActionLabel|Pick into branch" msgstr "" @@ -1355,6 +1379,9 @@ msgstr "" msgid "Checking branch availability..." msgstr "" +msgid "Checking username availability..." +msgstr "" + msgid "Cherry-pick this commit" msgstr "" @@ -1511,6 +1538,12 @@ msgstr "" msgid "Click the button below to begin the install process by navigating to the Kubernetes page" msgstr "" +msgid "Click the link below to confirm your email address (%{email})" +msgstr "" + +msgid "Click the link below to confirm your email address." +msgstr "" + msgid "Click to expand it." msgstr "" @@ -2079,6 +2112,15 @@ msgstr "" msgid "Configure the way a user creates a new account." msgstr "" +msgid "Confirm new password" +msgstr "" + +msgid "Confirm your account" +msgstr "" + +msgid "Confirm your email address" +msgstr "" + msgid "Connect" msgstr "" @@ -2328,6 +2370,9 @@ msgstr "" msgid "Cron syntax" msgstr "" +msgid "Crowd" +msgstr "" + msgid "Current Branch" msgstr "" @@ -2588,6 +2633,15 @@ msgstr "" msgid "Detect host keys" msgstr "" +msgid "Didn't receive a confirmation email?" +msgstr "" + +msgid "Didn't receive confirmation instructions?" +msgstr "" + +msgid "Didn't receive unlock instructions?" +msgstr "" + msgid "Diffs|No file name available" msgstr "" @@ -2780,6 +2834,9 @@ msgstr "" msgid "Enter in your Bitbucket Server URL and personal access token below" msgstr "" +msgid "Enter the code from the two-factor app on your mobile device. If you've lost your device, you may enter one of your recovery codes." +msgstr "" + msgid "Environments" msgstr "" @@ -3128,6 +3185,9 @@ msgstr "" msgid "For public projects, anyone can view pipelines and access job details (output logs and artifacts)" msgstr "" +msgid "Forgot your password?" +msgstr "" + msgid "Fork" msgid_plural "Forks" msgstr[0] "" @@ -3175,6 +3235,9 @@ msgstr "" msgid "From the Kubernetes cluster details view, install Runner from the applications list" msgstr "" +msgid "Full name" +msgstr "" + msgid "GPG Keys" msgstr "" @@ -3733,6 +3796,9 @@ msgstr "" msgid "HealthCheck|Unhealthy" msgstr "" +msgid "Hello, %{name}!" +msgstr "" + msgid "Help" msgstr "" @@ -3828,12 +3894,24 @@ msgstr "" msgid "If enabled, access to projects will be validated on an external service using their classification label." msgstr "" +msgid "If this email was added in error, you can remove it here:" +msgstr "" + +msgid "If this email was added in error, you can remove it here: %{profile_emails_url}" +msgstr "" + msgid "If using GitHub, you’ll see pipeline statuses on GitHub for your commits and pull requests. %{more_info_link}" msgstr "" msgid "If you already have files you can push them using the %{link_to_cli} below." msgstr "" +msgid "If you did not initiate this change, please contact your administrator immediately." +msgstr "" + +msgid "If you did not perform this request, you can safely ignore this email." +msgstr "" + msgid "If your HTTP repository is not publicly accessible, add authentication information to the URL: https://username:password@gitlab.company.com/group/project.git." msgstr "" @@ -4022,6 +4100,9 @@ msgstr "" msgid "June" msgstr "" +msgid "Kerberos" +msgstr "" + msgid "Koding" msgstr "" @@ -4566,6 +4647,12 @@ msgstr "" msgid "Milestones|This action cannot be reversed." msgstr "" +msgid "Minimum length is %{minimum_password_length} characters" +msgstr "" + +msgid "Minimum length is %{minimum_password_length} characters." +msgstr "" + msgid "Mirror a repository" msgstr "" @@ -4715,6 +4802,9 @@ msgstr "" msgid "New merge request" msgstr "" +msgid "New password" +msgstr "" + msgid "New pipelines will cancel older, pending pipelines on the same branch" msgstr "" @@ -4745,12 +4835,18 @@ msgstr "" msgid "No assignee" msgstr "" +msgid "No authentication methods configured." +msgstr "" + msgid "No branches found" msgstr "" msgid "No changes" msgstr "" +msgid "No confirmation email received? Please check your spam folder or" +msgstr "" + msgid "No connection could be made to a Gitaly Server, please check your logs!" msgstr "" @@ -5023,6 +5119,12 @@ msgstr "" msgid "Otherwise it is recommended you start with one of the options below." msgstr "" +msgid "Otherwise, click the link below to complete the process." +msgstr "" + +msgid "Otherwise, click the link below to complete the process:" +msgstr "" + msgid "Outbound requests" msgstr "" @@ -5266,15 +5368,27 @@ msgstr "" msgid "Please accept the Terms of Service before continuing." msgstr "" +msgid "Please check your email to confirm your account" +msgstr "" + msgid "Please convert them to %{link_to_git}, and go through the %{link_to_import_flow} again." msgstr "" msgid "Please convert them to Git on Google Code, and go through the %{link_to_import_flow} again." msgstr "" +msgid "Please create a username with only alphanumeric characters." +msgstr "" + msgid "Please note that this application is not provided by GitLab and you should verify its authenticity before allowing access." msgstr "" +msgid "Please provide a valid email address." +msgstr "" + +msgid "Please retype the email address." +msgstr "" + msgid "Please select at least one filter to see results" msgstr "" @@ -5760,6 +5874,9 @@ msgstr[1] "" msgid "Regenerate key" msgstr "" +msgid "Register" +msgstr "" + msgid "Register / Sign In" msgstr "" @@ -5793,6 +5910,9 @@ msgstr "" msgid "Related merge requests" msgstr "" +msgid "Remember me" +msgstr "" + msgid "Remind later" msgstr "" @@ -5883,18 +6003,36 @@ msgstr "" msgid "Request Access" msgstr "" +msgid "Request a new one" +msgstr "" + +msgid "Request new confirmation email" +msgstr "" + msgid "Requests Profiles" msgstr "" msgid "Require all users to accept Terms of Service and Privacy Policy when they access GitLab." msgstr "" +msgid "Resend" +msgstr "" + +msgid "Resend unlock instructions" +msgstr "" + +msgid "Reset Password" +msgstr "" + msgid "Reset git storage health information" msgstr "" msgid "Reset health check access token" msgstr "" +msgid "Reset password" +msgstr "" + msgid "Reset runners registration token" msgstr "" @@ -6303,12 +6441,18 @@ msgstr "" msgid "Sign in to %{group_name}" msgstr "" +msgid "Sign in with  " +msgstr "" + msgid "Sign in with Single Sign-On" msgstr "" msgid "Sign out" msgstr "" +msgid "Sign up" +msgstr "" + msgid "Sign-in restrictions" msgstr "" @@ -6330,6 +6474,12 @@ msgstr "" msgid "Snippets" msgstr "" +msgid "Someone, hopefully you, has requested to reset the password for your GitLab account on %{gitlab_url}" +msgstr "" + +msgid "Someone, hopefully you, has requested to reset the password for your GitLab account on %{link_to_gitlab}." +msgstr "" + msgid "Something went wrong on our end" msgstr "" @@ -6519,6 +6669,9 @@ msgstr "" msgid "Staged %{type}" msgstr "" +msgid "Standard" +msgstr "" + msgid "Star a label to make it a priority label. Order the prioritized labels to change their relative priority, by dragging." msgstr "" @@ -6704,6 +6857,9 @@ msgstr "" msgid "Test coverage parsing" msgstr "" +msgid "Thanks for signing up to GitLab!" +msgstr "" + msgid "Thanks! Don't show me this again" msgstr "" @@ -6755,6 +6911,12 @@ msgstr "" msgid "The passphrase required to decrypt the private key. This is optional and the value is encrypted at rest." msgstr "" +msgid "The password for your GitLab account on %{gitlab_url} has successfully been changed." +msgstr "" + +msgid "The password for your GitLab account on %{link_to_gitlab} has successfully been changed." +msgstr "" + msgid "The path to CI config file. Defaults to .gitlab-ci.yml" msgstr "" @@ -6893,6 +7055,12 @@ msgstr "" msgid "This directory" msgstr "" +msgid "This field is required" +msgstr "" + +msgid "This field is required." +msgstr "" + msgid "This group" msgstr "" @@ -7191,9 +7359,15 @@ msgstr "" msgid "To get started you enter your FogBugz URL and login information below. In the next steps, you'll be able to map users and select the projects you want to import." msgstr "" +msgid "To get started, click the link below to confirm your account." +msgstr "" + msgid "To get started, please enter your Gitea Host URL and a %{link_to_personal_token}." msgstr "" +msgid "To get started, use the link below to confirm your account." +msgstr "" + msgid "To import GitHub repositories, you can use a %{personal_access_token_link}. When you create your Personal Access Token, you will need to select the repo scope, so we can display a list of your public and private repositories which are available to import." msgstr "" @@ -7299,18 +7473,30 @@ msgstr "" msgid "Twitter" msgstr "" +msgid "Two-Factor Authentication" +msgstr "" + +msgid "Two-Factor Authentication code" +msgstr "" + msgid "Unable to load the diff. %{button_try_again}" msgstr "" msgid "Unable to sign you in to the group with SAML due to \"%{reason}\"" msgstr "" +msgid "Unhappy?" +msgstr "" + msgid "Unknown" msgstr "" msgid "Unlock" msgstr "" +msgid "Unlock account" +msgstr "" + msgid "Unlock this %{issuableDisplayName}? Everyone will be able to comment." msgstr "" @@ -7419,6 +7605,12 @@ msgstr "" msgid "Use the following registration token during setup:" msgstr "" +msgid "Use the link below to confirm your email address (%{email})" +msgstr "" + +msgid "Use the link below to confirm your email address." +msgstr "" + msgid "Use your global notification setting" msgstr "" @@ -7434,6 +7626,15 @@ msgstr "" msgid "User map" msgstr "" +msgid "Username is already taken." +msgstr "" + +msgid "Username is available." +msgstr "" + +msgid "Username or email" +msgstr "" + msgid "Users" msgstr "" @@ -7461,6 +7662,9 @@ msgstr "" msgid "Verified" msgstr "" +msgid "Verify code" +msgstr "" + msgid "View epics list" msgstr "" @@ -7545,6 +7749,9 @@ msgstr "" msgid "Weight %{weight}" msgstr "" +msgid "Welcome, %{name}!" +msgstr "" + msgid "When a runner is locked, it cannot be assigned to other projects" msgstr "" @@ -7833,6 +8040,9 @@ msgstr "" msgid "YouTube" msgstr "" +msgid "Your GitLab account has been locked due to an excessive amount of unsuccessful sign in attempts. Your account will automatically unlock in %{duration} or you may click the link below to unlock now." +msgstr "" + msgid "Your Groups" msgstr "" diff --git a/qa/qa/page/main/login.rb b/qa/qa/page/main/login.rb index 6cdfbd1c125989..1178370b2910a8 100644 --- a/qa/qa/page/main/login.rb +++ b/qa/qa/page/main/login.rb @@ -5,24 +5,24 @@ class Login < Page::Base view 'app/views/devise/passwords/edit.html.haml' do element :password_field, 'password_field :password' element :password_confirmation, 'password_field :password_confirmation' - element :change_password_button, 'submit "Change your password"' + element :change_password_button, 'submit _("Change your password")' end view 'app/views/devise/sessions/_new_base.html.haml' do element :login_field, 'text_field :login' element :password_field, 'password_field :password' - element :sign_in_button, 'submit "Sign in"' + element :sign_in_button, 'submit _("Sign in")' end view 'app/views/devise/sessions/_new_ldap.html.haml' do element :username_field, 'text_field_tag :username' element :password_field, 'password_field_tag :password' - element :sign_in_button, 'submit_tag "Sign in"' + element :sign_in_button, 'submit_tag _("Sign in")' end view 'app/views/devise/shared/_tabs_ldap.html.haml' do element :ldap_tab, "link_to server['label']" - element :standard_tab, "link_to 'Standard'" + element :standard_tab, "link_to _('Standard')" end view 'app/views/devise/shared/_tabs_normal.html.haml' do diff --git a/qa/qa/page/main/sign_up.rb b/qa/qa/page/main/sign_up.rb index 9a834e94b81865..be3fbc25a5a3d1 100644 --- a/qa/qa/page/main/sign_up.rb +++ b/qa/qa/page/main/sign_up.rb @@ -8,7 +8,7 @@ class SignUp < Page::Base element :email_field, 'email_field :email' element :email_confirmation, 'email_field :email_confirmation' element :password, 'password_field :password' - element :register_button, 'submit "Register"' + element :register_button, 'submit _("Register")' end def sign_up!(name:, username:, email:, password:) -- GitLab