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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,5 +1,4 @@
%p %p= t('.greeting', recipient: @resource.email)
Hello #{@resource.email}! %p= t('.message')
%p Your account has been locked due to an excessive number of unsuccessful sign in attempts. %p= t('.instruction')
%p Click the link below to unlock your account: %p= link_to t('.action'), unlock_url(@resource, unlock_token: @token)
%p= link_to 'Unlock my account', 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| = form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f|
= render "devise/shared/error_messages", resource: resource = render "devise/shared/error_messages", resource: resource
= f.hidden_field :reset_password_token = f.hidden_field :reset_password_token
.field .field
= f.label :password, "New password" = f.label :password, t('.new_password')
%br/ %br/
- if @minimum_password_length - if @minimum_password_length
%em %em= t('devise.shared.minimum_password_length', count: @minimum_password_length)
(#{@minimum_password_length} characters minimum)
%br/ %br/
= f.password_field :password, autofocus: true, autocomplete: "new-password" = f.password_field :password, autofocus: true, autocomplete: "new-password"
.field .field
= f.label :password_confirmation, "Confirm new password" = f.label :password_confirmation, t('.confirm_new_password')
%br/ %br/
= f.password_field :password_confirmation, autocomplete: "off" = f.password_field :password_confirmation, autocomplete: "off"
.actions .actions
= f.submit "Change my password" = f.submit t('.change_my_password')
= render "devise/shared/links" = 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| = form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f|
= render "devise/shared/error_messages", resource: resource = render "devise/shared/error_messages", resource: resource
.field .field
@ -6,5 +6,5 @@
%br/ %br/
= f.email_field :email, autofocus: true, autocomplete: "email" = f.email_field :email, autofocus: true, autocomplete: "email"
.actions .actions
= f.submit "Send me reset password instructions" = f.submit t('.send_me_reset_password_instructions')
= render "devise/shared/links" = render "devise/shared/links"

View File

@ -1,36 +1,35 @@
%h2 %h2= t('.title', resource: resource.model_name.human)
Edit #{resource_name.to_s.humanize} = form_for(resource, as: resource_name, url: send("#{resource_name}_registration_path"), html: { method: :put }) do |f|
= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f|
= render "devise/shared/error_messages", resource: resource = render "devise/shared/error_messages", resource: resource
.field .field
= f.label :email = f.label :email
%br/ %br/
= f.email_field :email, autofocus: true, autocomplete: "email" = f.email_field :email, autofocus: true, autocomplete: "email"
- if devise_mapping.confirmable? && resource.pending_reconfirmation? - if devise_mapping.confirmable? && resource.pending_reconfirmation?
%div %div= t('.currently_waiting_confirmation_for_email', email: resource.unconfirmed_email)
Currently waiting confirmation for: #{resource.unconfirmed_email}
.field .field
= f.label :password = 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/ %br/
= f.password_field :password, autocomplete: "new-password" = f.password_field :password, autocomplete: "new-password"
- if @minimum_password_length - if @minimum_password_length
%br/ %br/
%em %em= t('devise.shared.minimum_password_length', count: @minimum_password_length)
= @minimum_password_length
characters minimum
.field .field
= f.label :password_confirmation = f.label :password_confirmation
%br/ %br/
= f.password_field :password_confirmation, autocomplete: "new-password" = f.password_field :password_confirmation, autocomplete: "new-password"
.field .field
= f.label :current_password = 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/ %br/
= f.password_field :current_password, autocomplete: "current-password" = f.password_field :current_password, autocomplete: "current-password"
.actions .actions
= f.submit "Update" = f.submit t('.update')
%h3 Cancel my account %h3= t('.cancel_my_account')
%p %p
Unhappy? #{button_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete} = t('.unhappy')
= link_to "Back", :back = 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| = form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f|
= render "devise/shared/error_messages", resource: resource = render "devise/shared/error_messages", resource: resource
.field .field
@ -8,8 +8,7 @@
.field .field
= f.label :password = f.label :password
- if @minimum_password_length - if @minimum_password_length
%em %em= t('devise.shared.minimum_password_length', count: @minimum_password_length)
(#{@minimum_password_length} characters minimum)
%br/ %br/
= f.password_field :password, autocomplete: "new-password" = f.password_field :password, autocomplete: "new-password"
.field .field
@ -17,5 +16,5 @@
%br/ %br/
= f.password_field :password_confirmation, autocomplete: "new-password" = f.password_field :password_confirmation, autocomplete: "new-password"
.actions .actions
= f.submit "Sign up" = f.submit t('.sign_up')
= render "devise/shared/links" = 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| = form_for(resource, as: resource_name, url: session_path(resource_name)) do |f|
.field.login .field.login
= f.label :login = f.label :login
%br/ %br/
= f.text_field :login, autofocus: true, autocomplete: 'login' = f.email_field :login, autofocus: true, autocomplete: "login"
.field.password .field.password
= f.label :password = f.label :password
%br/ %br/
= f.password_field :password, autocomplete: 'current-password' = f.password_field :password, autocomplete: "current-password"
- if devise_mapping.rememberable? - if devise_mapping.rememberable?
.field .field
= f.label :remember_me = f.label :remember_me
= f.check_box :remember_me = f.check_box :remember_me
.actions .actions
= f.submit t('.sign_in') = f.submit t('.sign_in')
= render "devise/shared/links"
= render 'devise/shared/links'

View File

@ -1,19 +1,19 @@
- if controller_name != 'sessions' - if controller_name != 'sessions'
= link_to "Log in", new_session_path(resource_name) = link_to t(".sign_in"), new_session_path(resource_name)
%br/ %br/
- if devise_mapping.registerable? && controller_name != 'registrations' - 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/ %br/
- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' - 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/ %br/
- if devise_mapping.confirmable? && controller_name != 'confirmations' - 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/ %br/
- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' - 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/ %br/
- if devise_mapping.omniauthable? - if devise_mapping.omniauthable?
- resource_class.omniauth_providers.each do |provider| - 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/ %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| = form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f|
= render "devise/shared/error_messages", resource: resource = render "devise/shared/error_messages", resource: resource
.field .field
@ -6,5 +6,5 @@
%br/ %br/
= f.email_field :email, autofocus: true, autocomplete: "email" = f.email_field :email, autofocus: true, autocomplete: "email"
.actions .actions
= f.submit "Resend unlock instructions" = f.submit t('.resend_unlock_instructions')
= render "devise/shared/links" = render "devise/shared/links"

View File

@ -88,7 +88,11 @@
author: "#{note.author.firstname} #{note.author.lastname}", author: "#{note.author.firstname} #{note.author.lastname}",
date: l(note.date, format: :at) rescue nil 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 = link_to destroy_user_session_path, method: :delete do
%em.fa.fa-sign-out-alt %em.fa.fa-sign-out-alt
= t 'logout' = t 'logout'