diff options
author | Bob Van Landuyt <bob@gitlab.com> | 2019-05-31 09:06:24 +0000 |
---|---|---|
committer | Bob Van Landuyt <bob@gitlab.com> | 2019-05-31 09:06:24 +0000 |
commit | faf506ea770bab6b746183790316e069e51e901c (patch) | |
tree | c12870bc6ac5484f63a0db2c5ea5bea6a3dec670 | |
parent | b095a0818d148cf930b979008dba333660bb813b (diff) | |
parent | ffb3fa52cafe437be87abbc9c8b3366df2fa1f80 (diff) | |
download | gitlab-ce-faf506ea770bab6b746183790316e069e51e901c.tar.gz |
Merge branch 'i18n-password-of-user-profile' into 'master'
Externalize strings of password page in user profile
See merge request gitlab-org/gitlab-ce!28744
-rw-r--r-- | app/controllers/profiles/passwords_controller.rb | 10 | ||||
-rw-r--r-- | app/views/profiles/passwords/edit.html.haml | 25 | ||||
-rw-r--r-- | app/views/profiles/passwords/new.html.haml | 6 | ||||
-rw-r--r-- | locale/gitlab.pot | 42 |
4 files changed, 63 insertions, 20 deletions
diff --git a/app/controllers/profiles/passwords_controller.rb b/app/controllers/profiles/passwords_controller.rb index 7038447581c..d2787c2e450 100644 --- a/app/controllers/profiles/passwords_controller.rb +++ b/app/controllers/profiles/passwords_controller.rb @@ -14,7 +14,7 @@ class Profiles::PasswordsController < Profiles::ApplicationController def create unless @user.password_automatically_set || @user.valid_password?(user_params[:current_password]) - redirect_to new_profile_password_path, alert: 'You must provide a valid current password' + redirect_to new_profile_password_path, alert: _('You must provide a valid current password') return end @@ -29,7 +29,7 @@ class Profiles::PasswordsController < Profiles::ApplicationController if result[:status] == :success Users::UpdateService.new(current_user, user: @user, password_expires_at: nil).execute - redirect_to root_path, notice: 'Password successfully changed' + redirect_to root_path, notice: _('Password successfully changed') else render :new end @@ -45,14 +45,14 @@ class Profiles::PasswordsController < Profiles::ApplicationController password_attributes[:password_automatically_set] = false unless @user.password_automatically_set || @user.valid_password?(user_params[:current_password]) - redirect_to edit_profile_password_path, alert: 'You must provide a valid current password' + redirect_to edit_profile_password_path, alert: _('You must provide a valid current password') return end result = Users::UpdateService.new(current_user, password_attributes.merge(user: @user)).execute if result[:status] == :success - flash[:notice] = "Password was successfully updated. Please login with it" + flash[:notice] = _('Password was successfully updated. Please login with it') redirect_to new_user_session_path else @user.reset @@ -62,7 +62,7 @@ class Profiles::PasswordsController < Profiles::ApplicationController def reset current_user.send_reset_password_instructions - redirect_to edit_profile_password_path, notice: 'We sent you an email with reset password instructions' + redirect_to edit_profile_password_path, notice: _('We sent you an email with reset password instructions') end private diff --git a/app/views/profiles/passwords/edit.html.haml b/app/views/profiles/passwords/edit.html.haml index 0b4b9841ea1..ac8c31189d0 100644 --- a/app/views/profiles/passwords/edit.html.haml +++ b/app/views/profiles/passwords/edit.html.haml @@ -1,5 +1,5 @@ -- breadcrumb_title "Edit Password" -- page_title "Password" +- breadcrumb_title _('Edit Password') +- page_title _('Password') - @content_class = "limit-container-width" unless fluid_layout .row.prepend-top-default @@ -7,28 +7,29 @@ %h4.prepend-top-0 = page_title %p - After a successful password update, you will be redirected to the login page where you can log in with your new password. + = _('After a successful password update, you will be redirected to the login page where you can log in with your new password.') .col-lg-8 %h5.prepend-top-0 - Change your password - - unless @user.password_automatically_set? - or recover your current one + - if @user.password_automatically_set + = _('Change your password') + - else + = _('Change your password or recover your current one') = form_for @user, url: profile_password_path, method: :put, html: {class: "update-password"} do |f| = form_errors(@user) - unless @user.password_automatically_set? .form-group - = f.label :current_password, class: 'label-bold' + = f.label :current_password, _('Current password'), class: 'label-bold' = f.password_field :current_password, required: true, class: 'form-control' %p.form-text.text-muted - You must provide your current password in order to change it. + = _('You must provide your current password in order to change it.') .form-group - = f.label :password, 'New password', class: 'label-bold' + = f.label :password, _('New password'), class: 'label-bold' = f.password_field :password, required: true, class: 'form-control' .form-group - = f.label :password_confirmation, class: 'label-bold' + = f.label :password_confirmation, _('Password confirmation'), class: 'label-bold' = f.password_field :password_confirmation, required: true, class: 'form-control' .prepend-top-default.append-bottom-default - = f.submit 'Save password', class: "btn btn-success append-right-10" + = f.submit _('Save password'), class: "btn btn-success append-right-10" - unless @user.password_automatically_set? - = link_to "I forgot my password", reset_profile_password_path, method: :put, class: "account-btn-link" + = link_to _('I forgot my password'), reset_profile_password_path, method: :put, class: "account-btn-link" diff --git a/app/views/profiles/passwords/new.html.haml b/app/views/profiles/passwords/new.html.haml index 081166270ab..ce60455ab89 100644 --- a/app/views/profiles/passwords/new.html.haml +++ b/app/views/profiles/passwords/new.html.haml @@ -14,17 +14,17 @@ - unless @user.password_automatically_set? .form-group.row .col-sm-2.col-form-label - = f.label :current_password + = f.label :current_password, _('Current password') .col-sm-10 = f.password_field :current_password, required: true, class: 'form-control' .form-group.row .col-sm-2.col-form-label - = f.label :password + = f.label :password, _('New password') .col-sm-10 = f.password_field :password, required: true, class: 'form-control' .form-group.row .col-sm-2.col-form-label - = f.label :password_confirmation + = f.label :password_confirmation, _('Password confirmation') .col-sm-10 = f.password_field :password_confirmation, required: true, class: 'form-control' .form-actions diff --git a/locale/gitlab.pot b/locale/gitlab.pot index a02c5e41721..78b80d19359 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -754,6 +754,9 @@ msgstr "" msgid "After a successful password update you will be redirected to login screen." msgstr "" +msgid "After a successful password update, you will be redirected to the login page where you can log in with your new password." +msgstr "" + msgid "All" msgstr "" @@ -1785,6 +1788,12 @@ msgstr "" msgid "Change title" msgstr "" +msgid "Change your password" +msgstr "" + +msgid "Change your password or recover your current one" +msgstr "" + msgid "ChangeTypeActionLabel|Pick into branch" msgstr "" @@ -3119,6 +3128,9 @@ msgstr "" msgid "Current Branch" msgstr "" +msgid "Current password" +msgstr "" + msgid "CurrentUser|Profile" msgstr "" @@ -3628,6 +3640,9 @@ msgstr "" msgid "Edit Milestone" msgstr "" +msgid "Edit Password" +msgstr "" + msgid "Edit Pipeline Schedule %{id}" msgstr "" @@ -5018,6 +5033,9 @@ msgstr "" msgid "I accept the|Terms of Service and Privacy Policy" msgstr "" +msgid "I forgot my password" +msgstr "" + msgid "I have read and agree to the Let's Encrypt %{link_start}Terms of Service%{link_end}" msgstr "" @@ -6398,6 +6416,9 @@ msgstr "" msgid "New milestone" msgstr "" +msgid "New password" +msgstr "" + msgid "New pipelines will cancel older, pending pipelines on the same branch" msgstr "" @@ -6856,6 +6877,15 @@ msgstr "" msgid "Password authentication is unavailable." msgstr "" +msgid "Password confirmation" +msgstr "" + +msgid "Password successfully changed" +msgstr "" + +msgid "Password was successfully updated. Please login with it" +msgstr "" + msgid "Past due" msgstr "" @@ -8534,6 +8564,9 @@ msgstr "" msgid "Save comment" msgstr "" +msgid "Save password" +msgstr "" + msgid "Save pipeline schedule" msgstr "" @@ -11179,6 +11212,9 @@ msgstr "" msgid "We heard back from your U2F device. You have been authenticated." msgstr "" +msgid "We sent you an email with reset password instructions" +msgstr "" + msgid "We want to be sure it is you, please confirm you are not a robot." msgstr "" @@ -11589,6 +11625,12 @@ msgstr "" msgid "You must have permission to create a project in a namespace before forking." msgstr "" +msgid "You must provide a valid current password" +msgstr "" + +msgid "You must provide your current password in order to change it." +msgstr "" + msgid "You need permission." msgstr "" |