Add translations for account settings

This commit is contained in:
Andreas Nedbal 2022-02-05 19:26:04 +01:00 committed by Andreas Nedbal
parent 452eca4afc
commit 540e5acaba
4 changed files with 32 additions and 27 deletions

View File

@ -1,4 +1,4 @@
= render 'settings/account' = render "settings/account"
- provide(:title, generate_title('Account Settings')) - provide(:title, generate_title(t(".title")))
- parent_layout 'user/settings' - parent_layout "user/settings"

View File

@ -2,15 +2,12 @@
.modal-dialog .modal-dialog
.modal-content .modal-content
.modal-header .modal-header
%h5.modal-title#modal-passwd-label= t 'views.settings.account.modal.title' %h5.modal-title#modal-passwd-label= t(".title")
%button.close{ data: { dismiss: :modal }, type: :button } %button.close{ data: { dismiss: :modal }, type: :button }
%span{ aria: { hidden: true } } × %span{ aria: { hidden: true } } ×
%span.sr-only= t 'views.actions.close' %span.sr-only= t("voc.close")
.modal-body .modal-body
= f.password_field :current_password, = f.password_field :current_password, autocomplete: :off
autocomplete: :off,
label: t('views.settings.account.password_current'),
help: t('views.settings.account.password_current_help')
.modal-footer .modal-footer
%button.btn.btn-default{ data: { dismiss: :modal }, type: :button }= t 'views.actions.cancel' %button.btn.btn-default{ data: { dismiss: :modal }, type: :button }= t("voc.cancel")
%button.btn.btn-primary{ type: :submit }= t 'views.actions.save' = f.primary

View File

@ -1,29 +1,26 @@
.card .card
.card-body .card-body
= bootstrap_form_for(resource, as: resource_name, url: '/settings/account', html: { method: :put }) do |f| = bootstrap_form_for(resource, as: resource_name, url: "/settings/account", html: { method: :put }) do |f|
= render 'modal/password', f: f = render "modal/password", f: f
= render "devise/shared/error_messages", resource: resource
= render 'devise/shared/error_messages', resource: resource = f.text_field :screen_name, autofocus: true
= f.text_field :screen_name, autofocus: true, label: t('views.settings.account.username') = f.email_field :email
= f.email_field :email, label: t('views.settings.account.email')
- if devise_mapping.confirmable? && resource.pending_reconfirmation? - if devise_mapping.confirmable? && resource.pending_reconfirmation?
%div= raw t('views.settings.account.email_confirm', resource: resource.unconfirmed_email) .alert.alert-info= raw t(".email_confirm", resource: resource.unconfirmed_email)
= f.password_field :password, autocomplete: :off, label: t('views.settings.account.password'), help: t('views.settings.account.password_help') = f.password_field :password, autocomplete: :off, help: t(".help.password")
= f.password_field :password_confirmation, autocomplete: :off, label: t('views.settings.account.password_confirm') = f.password_field :password_confirmation, autocomplete: :off
%button.btn.btn-primary{ data: { target: '#modal-passwd', toggle: :modal, type: :button } } %button.btn.btn-primary{ data: { target: "#modal-passwd", toggle: :modal, type: :button } }
= t 'views.actions.save' = t("voc.save")
%hr/ %hr/
%p %p
= t 'views.settings.account.unsatisfied' = t(".delete.heading")
= button_to t('views.settings.account.delete'), '/settings/account', data: { confirm: 'Are you sure?' }, method: :delete, class: 'btn btn-danger btn-xs' = button_to t(".delete.action"), "/settings/account", data: { confirm: t(".delete.confirm") }, method: :delete, class: "btn btn-danger btn-xs"
= link_to t('views.settings.account.back'), :back .visible-xs= render "shared/links"
.visible-xs= render 'shared/links'

View File

@ -20,10 +20,19 @@ en:
service: service:
post_tag: "Tag" post_tag: "Tag"
user: user:
current_password: "Current password"
email: "Email"
login: "Username or Email"
password: "Password"
password_confirmation: "Confirm your password"
profile_picture: "Profile picture" profile_picture: "Profile picture"
profile_header: "Profile header" profile_header: "Profile header"
screen_name: "Username"
show_foreign_themes: "Render other user themes when visiting their profile" show_foreign_themes: "Render other user themes when visiting their profile"
help: help:
user:
email: "Don't forget to check your spam folder in case our mail might have landed there!"
current_password: "We need your current password to confirm your changes"
profile: profile:
motivation_header: "Shown in the header of the question box on your profile. Motivate users to ask you questions!" motivation_header: "Shown in the header of the question box on your profile. Motivate users to ask you questions!"
services/twitter: services/twitter:
@ -31,6 +40,8 @@ en:
helpers: helpers:
submit: submit:
user: user:
new: "Sign in"
create: :voc.register
update: :voc.save update: :voc.save
profile: profile:
update: :voc.save update: :voc.save