diff options
Diffstat (limited to 'app/views/devise')
18 files changed, 71 insertions, 69 deletions
diff --git a/app/views/devise/mailer/_confirmation_instructions_account.html.haml b/app/views/devise/mailer/_confirmation_instructions_account.html.haml index 27ef586d90f..9d469ff6e7b 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? || !@resource.created_recently? #content = email_default_heading(@resource.unconfirmed_email || @resource.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 5bccb68bbe2..e6da78e3a3d 100644 --- a/app/views/devise/mailer/_confirmation_instructions_account.text.erb +++ b/app/views/devise/mailer/_confirmation_instructions_account.text.erb @@ -1,13 +1,13 @@ <% if @resource.unconfirmed_email.present? || !@resource.created_recently? %> <%= @resource.unconfirmed_email || @resource.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. -<% end %> +<%= _('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.text.erb b/app/views/devise/mailer/_confirmation_instructions_secondary.text.erb index b91498ccfae..ab46aaaca1a 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 %>, confirm your email address now! +<%= _(" %{name}, confirm your email address now! ") % { 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 5ec515285f2..5c0219ea3ad 100644 --- a/app/views/devise/mailer/password_change.html.haml +++ b/app/views/devise/mailer/password_change.html.haml @@ -1,8 +1,5 @@ -= 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 95923d9f8de..6a8128186f5 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/unlock_instructions.html.haml b/app/views/devise/mailer/unlock_instructions.html.haml index 8ddfd3ea74a..0c05ee4a6cd 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/passwords/edit.html.haml b/app/views/devise/passwords/edit.html.haml index 7876aed2c0a..10c04423589 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,16 @@ = render "devise/shared/error_messages", resource: resource = f.hidden_field :reset_password_token .form-group - = f.label 'New password', for: "user_password" - = f.password_field :password, class: "form-control gl-form-input top", required: true, title: 'This field is required', data: { qa_selector: 'password_field'} + = f.label _('New password'), for: "user_password" + = f.password_field :password, class: "form-control gl-form-input top", required: true, title: _('This field is required.'), data: { qa_selector: 'password_field'} .form-group - = f.label 'Confirm new password', for: "user_password_confirmation" - = f.password_field :password_confirmation, class: "form-control gl-form-input bottom", title: 'This field is required', data: { qa_selector: 'password_confirmation_field' }, required: true + = f.label _('Confirm new password'), for: "user_password_confirmation" + = f.password_field :password_confirmation, class: "form-control gl-form-input bottom", title: _('This field is required.'), data: { qa_selector: 'password_confirmation_field' }, required: true .clearfix - = f.submit "Change your password", class: "gl-button btn btn-confirm", data: { qa_selector: 'change_password_button' } + = f.submit _("Change your password"), class: "gl-button btn btn-confirm", data: { qa_selector: 'change_password_button' } .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 c4672a5b25e..ef876779ad6 100644 --- a/app/views/devise/passwords/new.html.haml +++ b/app/views/devise/passwords/new.html.haml @@ -5,9 +5,9 @@ = render "devise/shared/error_messages", resource: resource .form-group = f.label :email - = f.email_field :email, class: "form-control gl-form-input", required: true, value: params[:user_email], autofocus: true, title: 'Please provide a valid email address.' + = f.email_field :email, class: "form-control gl-form-input", required: true, value: params[:user_email], autofocus: true, title: _('Please provide a valid email address.') .clearfix - = f.submit "Reset password", class: "gl-button btn-confirm btn" + = f.submit _("Reset password"), class: "gl-button btn-confirm 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 5a1388ac7a1..eeaefb8c6ac 100644 --- a/app/views/devise/registrations/edit.html.erb +++ b/app/views/devise/registrations/edit.html.erb @@ -9,20 +9,20 @@ <div><%= f.label :name %><br /> <%= f.text_field :name %></div> - <div><%= f.label :password %> <i>(leave blank if you don't want to change it)</i><br /> + <div><%= f.label :password %> <i><%= _("(leave blank if you don't want to change it)") %></i><br /> <%= f.password_field :password %></div> <div><%= f.label :password_confirmation %><br /> <%= f.password_field :password_confirmation %></div> - <div><%= f.label :current_password %> <i>(we need your current password to confirm your changes)</i><br /> + <div><%= f.label :current_password %> <i><%= _("(we need your current password to confirm your changes)") %></i><br /> <%= f.password_field :current_password %></div> -<div><%= f.submit "Update", class: "input_button" %></div> +<div><%= f.submit _("Update"), class: "input_button" %></div> <% end %> -<h3>Cancel your account</h3> +<h3><%= _('Cancel your account') %></h3> -<p>Unhappy? <%= link_to "Cancel your account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete %>.</p> +<p><%= _('Unhappy?') %> <%= link_to _("Cancel your account"), registration_path(resource_name), data: { confirm: _("Are you sure?") }, method: :delete %>.</p> -<%= link_to "Back", :back %> +<%= link_to _("Back"), :back %> diff --git a/app/views/devise/sessions/_new_crowd.html.haml b/app/views/devise/sessions/_new_crowd.html.haml index 161e23d700e..769268748f4 100644 --- a/app/views/devise/sessions/_new_crowd.html.haml +++ b/app/views/devise/sessions/_new_crowd.html.haml @@ -1,13 +1,13 @@ = 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: "gl-button btn-confirm btn" + %span= _('Remember me') + = submit_tag _("Sign in"), class: "gl-button btn-confirm btn" diff --git a/app/views/devise/sessions/_new_ldap.html.haml b/app/views/devise/sessions/_new_ldap.html.haml index 19fcabb1a2e..f599a652b71 100644 --- a/app/views/devise/sessions/_new_ldap.html.haml +++ b/app/views/devise/sessions/_new_ldap.html.haml @@ -5,15 +5,15 @@ = 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 gl-form-input top", title: "This field is required.", autofocus: "autofocus", data: { qa_selector: 'username_field' }, required: true } + = text_field_tag :username, nil, { class: "form-control gl-form-input top", title: _("This field is required."), autofocus: "autofocus", data: { qa_selector: 'username_field' }, required: true } .form-group = label_tag :password - = password_field_tag :password, nil, { class: "form-control gl-form-input bottom", title: "This field is required.", data: { qa_selector: 'password_field' }, required: true } + = password_field_tag :password, nil, { class: "form-control gl-form-input bottom", title: _("This field is required."), data: { qa_selector: 'password_field' }, required: true } - if !hide_remember_me && devise_mapping.rememberable? .remember-me %label{ for: "remember_me" } = check_box_tag :remember_me, '1', false, id: 'remember_me' - %span Remember me + %span= _('Remember me') .submit-container.move-submit-down = submit_tag submit_message, class: "gl-button btn btn-confirm", data: { qa_selector: 'sign_in_button' } diff --git a/app/views/devise/sessions/new.html.haml b/app/views/devise/sessions/new.html.haml index cce0a3b926e..74f3e3e7e34 100644 --- a/app/views/devise/sessions/new.html.haml +++ b/app/views/devise/sessions/new.html.haml @@ -13,7 +13,7 @@ -# Show a message if none of the mechanisms above are enabled - if !password_authentication_enabled_for_web? && !ldap_sign_in_enabled? && !(omniauth_enabled? && devise_mapping.omniauthable?) %div - No authentication methods configured. + = _('No authentication methods configured.') - if allow_signup? %p.gl-mt-3 diff --git a/app/views/devise/sessions/two_factor.html.haml b/app/views/devise/sessions/two_factor.html.haml index 404484cfb93..29bcb3c158b 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,10 +7,10 @@ - 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 gl-form-input', required: true, autofocus: true, autocomplete: 'off', title: 'This field is required.', data: { qa_selector: 'two_fa_code_field' } - %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 gl-form-input', required: true, autofocus: true, autocomplete: 'off', title: _('This field is required.'), data: { qa_selector: 'two_fa_code_field' } + %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: "gl-button btn btn-confirm", data: { qa_selector: 'verify_code_button' } + = f.submit _("Verify code"), class: "gl-button btn btn-confirm", data: { qa_selector: 'verify_code_button' } - if @user.two_factor_webauthn_u2f_enabled? = render "authentication/authenticate", params: params, resource: resource, resource_name: resource_name, render_remember_me: true, target_path: new_user_session_path diff --git a/app/views/devise/shared/_email_opted_in.html.haml b/app/views/devise/shared/_email_opted_in.html.haml new file mode 100644 index 00000000000..6896ef21536 --- /dev/null +++ b/app/views/devise/shared/_email_opted_in.html.haml @@ -0,0 +1,7 @@ +- is_hidden = local_assigns.fetch(:hidden, Gitlab.dev_env_or_com?) + +.gl-mb-3.js-email-opt-in{ class: is_hidden ? 'hidden' : '' } + .gl-font-weight-bold.gl-mb-3 + = _('Email updates (optional)') + = f.check_box :email_opted_in + = f.label :email_opted_in, _("I'd like to receive updates about GitLab via email"), class: 'gl-font-weight-normal' diff --git a/app/views/devise/shared/_omniauth_box.html.haml b/app/views/devise/shared/_omniauth_box.html.haml index 3ec859551ca..8b54b735205 100644 --- a/app/views/devise/shared/_omniauth_box.html.haml +++ b/app/views/devise/shared/_omniauth_box.html.haml @@ -2,7 +2,7 @@ .omniauth-container.gl-mt-5 %label.label-bold.d-block - Sign in with + = _('Sign in with') - providers = enabled_button_based_providers .d-flex.justify-content-between.flex-wrap - providers.each do |provider| @@ -17,4 +17,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 9a7d8a0a160..0a48c342502 100644 --- a/app/views/devise/shared/_sign_in_link.html.haml +++ b/app/views/devise/shared/_sign_in_link.html.haml @@ -1,4 +1,6 @@ %p.text-center %span.light - Already have login and password? - = link_to "Sign in", new_session_path(:user, redirect_to_referer: 'yes') + = _('Already have login and password?') + - path_params = { redirect_to_referer: 'yes' } + - path_params[:invite_email] = @invite_email if @invite_email.present? + = link_to _('Sign in'), new_session_path(:user, path_params) diff --git a/app/views/devise/shared/_tabs_ldap.html.haml b/app/views/devise/shared/_tabs_ldap.html.haml index 27057d023b1..0ef4a30d820 100644 --- a/app/views/devise/shared/_tabs_ldap.html.haml +++ b/app/views/devise/shared/_tabs_ldap.html.haml @@ -4,7 +4,7 @@ %ul.nav-links.new-session-tabs.nav-tabs.nav{ class: ('custom-provider-tabs' if any_form_based_providers_enabled?) } - if crowd_enabled? %li.nav-item - = link_to "Crowd", "#crowd", class: "nav-link #{active_when(form_based_auth_provider_has_active_class?(:crowd))}", 'data-toggle' => 'tab', role: 'tab' + = link_to _("Crowd"), "#crowd", class: "nav-link #{active_when(form_based_auth_provider_has_active_class?(:crowd))}", 'data-toggle' => 'tab', role: 'tab' = render_if_exists "devise/shared/kerberos_tab" - ldap_servers.each_with_index do |server, i| %li.nav-item @@ -17,4 +17,4 @@ = link_to _('Standard'), '#login-pane', class: 'nav-link', data: { toggle: 'tab', qa_selector: 'standard_tab' }, role: 'tab' - if render_signup_link && allow_signup? %li.nav-item - = link_to 'Register', '#register-pane', class: 'nav-link', data: { toggle: 'tab', qa_selector: 'register_tab' }, role: 'tab' + = link_to _('Register'), '#register-pane', class: 'nav-link', data: { toggle: 'tab', qa_selector: 'register_tab' }, role: 'tab' diff --git a/app/views/devise/unlocks/new.html.haml b/app/views/devise/unlocks/new.html.haml index 398a4fa0c5e..abaf169afd5 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 @@ = render "devise/shared/error_messages", resource: resource .form-group.gl-mb-6 = 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: 'gl-button btn btn-confirm' + = f.submit _('Resend unlock instructions'), class: 'gl-button btn btn-confirm' .clearfix.prepend-top-20 = render 'devise/shared/sign_in_link' |