Translated devise views

This commit is contained in:
echarp 2019-05-10 18:06:39 +02:00
parent 1a0cb3a864
commit 04787793f4
14 changed files with 59 additions and 66 deletions

View File

@ -1,4 +1,4 @@
%h2 Resend confirmation instructions
%h2= t('.resend_confirmation_instructions')
= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f|
= render "devise/shared/error_messages", resource: resource
.field
@ -6,5 +6,5 @@
%br/
= f.email_field :email, autofocus: true, autocomplete: "email", value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email)
.actions
= f.submit "Resend confirmation instructions"
= f.submit t('.resend_confirmation_instructions')
= render "devise/shared/links"

View File

@ -1,4 +1,3 @@
%p
Welcome #{@email}!
%p You can confirm your account email through the link below:
%p= link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @token)
%p= t('.greeting', recipient: @email)
%p= t('.instruction')
%p= link_to t('.action'), confirmation_url(@resource, confirmation_token: @token)

View File

@ -1,8 +1,5 @@
%p
Hello #{@email}!
%p= t('.greeting', recipient: @email)
- if @resource.try(:unconfirmed_email?)
%p
We're contacting you to notify you that your email is being changed to #{@resource.unconfirmed_email}.
%p= t('.message', email: @resource.unconfirmed_email)
- else
%p
We're contacting you to notify you that your email has been changed to #{@resource.email}.
%p= t('.message', email: @resource.email)

View File

@ -1,3 +1,2 @@
%p
Hello #{@resource.email}!
%p We're contacting you to notify you that your password has been changed.
%p= t('.greeting', recipient: @resource.email)
%p= t('.message')

View File

@ -1,6 +1,5 @@
%p
Hello #{@resource.email}!
%p Someone has requested a link to change your password. You can do this through the link below.
%p= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token)
%p If you didn't request this, please ignore this email.
%p Your password won't change until you access the link above and create a new one.
%p= t('.greeting', recipient: @resource.email)
%p= t('.instruction')
%p= link_to t('.action'), edit_password_url(@resource, reset_password_token: @token)
%p= t('.instruction_2')
%p= t('.instruction_3')

View File

@ -1,5 +1,4 @@
%p
Hello #{@resource.email}!
%p Your account has been locked due to an excessive number of unsuccessful sign in attempts.
%p Click the link below to unlock your account:
%p= link_to 'Unlock my account', unlock_url(@resource, unlock_token: @token)
%p= t('.greeting', recipient: @resource.email)
%p= t('.message')
%p= t('.instruction')
%p= link_to t('.action'), unlock_url(@resource, unlock_token: @token)

View File

@ -1,19 +1,18 @@
%h2 Change your password
%h2= t('.change_your_password')
= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f|
= render "devise/shared/error_messages", resource: resource
= f.hidden_field :reset_password_token
.field
= f.label :password, "New password"
= f.label :password, t('.new_password')
%br/
- if @minimum_password_length
%em
(#{@minimum_password_length} characters minimum)
%em= t('devise.shared.minimum_password_length', count: @minimum_password_length)
%br/
= f.password_field :password, autofocus: true, autocomplete: "new-password"
.field
= f.label :password_confirmation, "Confirm new password"
= f.label :password_confirmation, t('.confirm_new_password')
%br/
= f.password_field :password_confirmation, autocomplete: "off"
.actions
= f.submit "Change my password"
= f.submit t('.change_my_password')
= render "devise/shared/links"

View File

@ -1,4 +1,4 @@
%h2 Forgot your password?
%h2= t('.forgot_your_password')
= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f|
= render "devise/shared/error_messages", resource: resource
.field
@ -6,5 +6,5 @@
%br/
= f.email_field :email, autofocus: true, autocomplete: "email"
.actions
= f.submit "Send me reset password instructions"
= f.submit t('.send_me_reset_password_instructions')
= render "devise/shared/links"

View File

@ -1,36 +1,35 @@
%h2
Edit #{resource_name.to_s.humanize}
= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f|
%h2= t('.title', resource: resource.model_name.human)
= form_for(resource, as: resource_name, url: send("#{resource_name}_registration_path"), html: { method: :put }) do |f|
= render "devise/shared/error_messages", resource: resource
.field
= f.label :email
%br/
= f.email_field :email, autofocus: true, autocomplete: "email"
- if devise_mapping.confirmable? && resource.pending_reconfirmation?
%div
Currently waiting confirmation for: #{resource.unconfirmed_email}
%div= t('.currently_waiting_confirmation_for_email', email: resource.unconfirmed_email)
.field
= f.label :password
%i (leave blank if you don't want to change it)
%i
(#{t('.leave_blank_if_you_don_t_want_to_change_it')})
%br/
= f.password_field :password, autocomplete: "new-password"
- if @minimum_password_length
%br/
%em
= @minimum_password_length
characters minimum
%em= t('devise.shared.minimum_password_length', count: @minimum_password_length)
.field
= f.label :password_confirmation
%br/
= f.password_field :password_confirmation, autocomplete: "new-password"
.field
= f.label :current_password
%i (we need your current password to confirm your changes)
%i
(#{t('.we_need_your_current_password_to_confirm_your_changes')})
%br/
= f.password_field :current_password, autocomplete: "current-password"
.actions
= f.submit "Update"
%h3 Cancel my account
= f.submit t('.update')
%h3= t('.cancel_my_account')
%p
Unhappy? #{button_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete}
= link_to "Back", :back
= t('.unhappy')
= button_to t('.cancel_my_account'), send("#{resource_name}_registration_path"), data: { confirm: t('.are_you_sure') }, method: :delete
= link_to t('devise.shared.links.back'), :back

View File

@ -1,4 +1,4 @@
%h2 Sign up
%h2= t('.sign_up')
= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f|
= render "devise/shared/error_messages", resource: resource
.field
@ -8,8 +8,7 @@
.field
= f.label :password
- if @minimum_password_length
%em
(#{@minimum_password_length} characters minimum)
%em= t('devise.shared.minimum_password_length', count: @minimum_password_length)
%br/
= f.password_field :password, autocomplete: "new-password"
.field
@ -17,5 +16,5 @@
%br/
= f.password_field :password_confirmation, autocomplete: "new-password"
.actions
= f.submit "Sign up"
= f.submit t('.sign_up')
= render "devise/shared/links"

View File

@ -1,18 +1,17 @@
%h2= t '.title'
%h2= t('.sign_in')
= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f|
.field.login
= f.label :login
%br/
= f.text_field :login, autofocus: true, autocomplete: 'login'
= f.email_field :login, autofocus: true, autocomplete: "login"
.field.password
= f.label :password
%br/
= f.password_field :password, autocomplete: 'current-password'
= f.password_field :password, autocomplete: "current-password"
- if devise_mapping.rememberable?
.field
= f.label :remember_me
= f.check_box :remember_me
.actions
= f.submit t('.sign_in')
= render 'devise/shared/links'
= render "devise/shared/links"

View File

@ -1,19 +1,19 @@
- if controller_name != 'sessions'
= link_to "Log in", new_session_path(resource_name)
= link_to t(".sign_in"), new_session_path(resource_name)
%br/
- if devise_mapping.registerable? && controller_name != 'registrations'
= link_to "Sign up", new_registration_path(resource_name)
= link_to t(".sign_up"), new_registration_path(resource_name)
%br/
- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations'
= link_to "Forgot your password?", new_password_path(resource_name)
= link_to t(".forgot_your_password"), new_password_path(resource_name)
%br/
- if devise_mapping.confirmable? && controller_name != 'confirmations'
= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name)
= link_to t('.didn_t_receive_confirmation_instructions'), new_confirmation_path(resource_name)
%br/
- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks'
= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name)
= link_to t('.didn_t_receive_unlock_instructions'), new_unlock_path(resource_name)
%br/
- if devise_mapping.omniauthable?
- resource_class.omniauth_providers.each do |provider|
= link_to "Sign in with #{OmniAuth::Utils.camelize(provider)}", omniauth_authorize_path(resource_name, provider)
= link_to t('.sign_in_with_provider', provider: OmniAuth::Utils.camelize(provider)), omniauth_authorize_path(resource_name, provider)
%br/

View File

@ -1,4 +1,4 @@
%h2 Resend unlock instructions
%h2= t('.resend_unlock_instructions')
= form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f|
= render "devise/shared/error_messages", resource: resource
.field
@ -6,5 +6,5 @@
%br/
= f.email_field :email, autofocus: true, autocomplete: "email"
.actions
= f.submit "Resend unlock instructions"
= f.submit t('.resend_unlock_instructions')
= render "devise/shared/links"

View File

@ -88,7 +88,11 @@
author: "#{note.author.firstname} #{note.author.lastname}",
date: l(note.date, format: :at) rescue nil
.logout
.actions
= link_to edit_user_registration_path do
%em.fa.fa-lock
= t('change_my_password', scope: 'devise.passwords.edit')
\|
= link_to destroy_user_session_path, method: :delete do
%em.fa.fa-sign-out-alt
= t 'logout'