Add internationalization (#114)

🇬🇧 and 🇮🇹
This commit is contained in:
Riccardo Graziosi
2022-06-05 11:40:43 +02:00
committed by GitHub
parent ba86e81aa0
commit 78049a820c
71 changed files with 802 additions and 266 deletions

View File

@@ -1,15 +1,21 @@
<%= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %>
<h2>Resend confirmation instructions</h2>
<h2><%= t('common.forms.auth.resend_confirmation_instructions') %></h2>
<%= render "devise/shared/error_messages", resource: resource %>
<div class="form-group">
<%= f.label :email, class: "sr-only" %>
<%= f.email_field :email, autofocus: true, autocomplete: "email", placeholder: "Email address", required: true, value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email), class: "form-control" %>
<%= f.email_field :email,
autofocus: true,
autocomplete: "email",
placeholder: t('common.forms.auth.email'),
required: true,
value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email),
class: "form-control" %>
</div>
<div class="actions">
<%= f.submit "Resend confirmation instructions", class: "btn btn-dark btn-block" %>
<%= f.submit t('common.forms.auth.resend_confirmation_instructions'), class: "btn btn-dark btn-block" %>
</div>
<% end %>

View File

@@ -1,26 +1,35 @@
<h2>Change your password</h2>
<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %>
<h2><%= t('common.forms.auth.change_password') %></h2>
<%= render "devise/shared/error_messages", resource: resource %>
<%= f.hidden_field :reset_password_token %>
<div class="form-group">
<%= f.label :password, "New password" %>
<%= f.password_field :password, autofocus: true, autocomplete: "new-password", class: "form-control" %>
<%= f.label :password, class: "sr-only" %>
<%= f.password_field :password,
autofocus: true,
autocomplete: "new-password",
placeholder: t('common.forms.auth.new_password'),
class: "form-control" %>
<% if @minimum_password_length %>
<small id="passwordHelp" class="form-text text-muted">
(<%= @minimum_password_length %> characters minimum)
(<%= t('common.forms.auth.password_help', { count: @minimum_password_length }) %>)
</small>
<% end %>
</div>
<div class="form-group">
<%= f.label :password_confirmation, "Confirm new password" %>
<%= f.password_field :password_confirmation, autocomplete: "new-password", class: "form-control" %>
<%= f.label :password_confirmation, class: "sr-only" %>
<%= f.password_field :password_confirmation,
autocomplete: "new-password",
placeholder: t('common.forms.auth.new_password_confirmation'),
class: "form-control" %>
</div>
<div class="actions">
<%= f.submit "Change my password", class: "btn btn-dark btn-primary" %>
<%= f.submit t('common.forms.auth.change_password'), class: "btn btn-dark btn-primary" %>
</div>
<% end %>

View File

@@ -1,15 +1,20 @@
<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %>
<h2>Forgot your password?</h2>
<h2><%= t('common.forms.auth.forgot_password') %></h2>
<%= render "devise/shared/error_messages", resource: resource %>
<div class="form-group">
<%= f.label :email, class: "sr-only" %>
<%= f.email_field :email, autofocus: true, autocomplete: "email", placeholder: "Email address", required: true, class: "form-control" %>
<%= f.email_field :email,
autofocus: true,
autocomplete: "email",
placeholder: t('common.forms.auth.email'),
required: true,
class: "form-control" %>
</div>
<div class="actions">
<%= f.submit "Send me reset password instructions", class: "btn btn-dark btn-block" %>
<%= f.submit t('common.forms.auth.send_reset_password_instructions'), class: "btn btn-dark btn-block" %>
</div>
<% end %>

View File

@@ -1,26 +1,23 @@
<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %>
<h2>Profile settings</h2>
<h2><%= t('common.forms.auth.profile_settings') %></h2>
<%= render "devise/shared/error_messages", resource: resource %>
<div class="form-group">
<%= f.label :full_name %>
<%= f.label t('common.forms.auth.full_name') %>
<%= f.text_field :full_name, autocomplete: "full-name", class: "form-control" %>
</div>
<div class="form-group">
<%= f.label :email %>
<%= f.label t('common.forms.auth.email') %>
<%= f.email_field :email, autocomplete: "email", class: "form-control" %>
<small id="emailGravatarHelp" class="form-text text-muted">
the email is <a href="https://gravatar.com" target="_blank">gravatar</a>ized
</small>
</div>
<div class="form-group">
<%= f.label :notifications_enabled %>&nbsp;
<%= f.label t('common.forms.auth.notifications_enabled') %>&nbsp;
<%= f.check_box :notifications_enabled, style: "transform: scale(1.5)" %>
<small id="notificationsHelp" class="form-text text-muted">
if disabled, you won't receive any notification
<%= t('common.forms.auth.notifications_enabled_help') %>
</small>
</div>
@@ -29,25 +26,20 @@
<% end %>
<div class="form-group">
<%= f.label :password %>
<%= f.label t('common.forms.auth.password') %>
<%= f.password_field :password, autocomplete: "new-password", class: "form-control" %>
<% if @minimum_password_length %>
<small id="passwordEditHelp" class="form-text text-muted">
leave blank if you don't want to change it
</small>
<small id="passwordHelp" class="form-text text-muted">
<%= @minimum_password_length %> characters minimum
</small>
<% end %>
<small id="passwordEditHelp" class="form-text text-muted">
leave blank if you don't want to change your password
</small>
</div>
<div class="form-group">
<%= f.label :password_confirmation %>
<%= f.label t('common.forms.auth.password_confirmation') %>
<%= f.password_field :password_confirmation, autocomplete: "new-password", class: "form-control" %>
</div>
<div class="form-group">
<%= f.label :current_password %>
<%= f.label t('common.forms.auth.current_password') %>
<%= f.password_field :current_password, autocomplete: "current-password", class: "form-control" %>
<small id="currentPasswordHelp" class="form-text text-muted">
we need your current password to confirm your changes
@@ -55,15 +47,18 @@
</div>
<div class="actions">
<%= f.submit "Update profile", class: "btn btn-dark btn-block" %>
<%= f.submit t('common.forms.auth.update_profile'), class: "btn btn-dark btn-block" %>
</div>
<% end %>
<br />
<div class="edit_user">
<h3>Cancel my account</h3>
<p>Unhappy?
<%= button_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete, class: "btn btn-danger btn-block" %>
</p>
<h3><%= t('common.forms.auth.cancel_account') %></h3>
<%= button_to t('common.forms.auth.cancel_account'),
registration_path(resource_name),
data: { confirm: "Are you sure?" },
method: :delete,
class: "btn btn-danger btn-block" %>
</div>

View File

@@ -1,30 +1,44 @@
<%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
<h2>Sign up</h2>
<h2><%= t('common.forms.auth.sign_up') %></h2>
<%= render "devise/shared/error_messages", resource: resource %>
<div class="form-group">
<%= f.label :full_name, class: "sr-only" %>
<%= f.text_field :full_name, autofocus: true, placeholder: "Full name", required: true, class: "form-control" %>
<%= f.text_field :full_name,
autofocus: true,
placeholder: t('common.forms.auth.full_name'),
required: true,
class: "form-control" %>
</div>
<div class="form-group">
<%= f.label :email, class: "sr-only" %>
<%= f.email_field :email, autocomplete: "email", placeholder: "Email address", required: true, class: "form-control" %>
<%= f.email_field :email,
autocomplete: "email",
placeholder: t('common.forms.auth.email'),
required: true,
class: "form-control" %>
</div>
<div class="form-group">
<%= f.label :password, class: "sr-only" %>
<%= f.password_field :password, placeholder: "Password", required: true, class: "form-control" %>
<%= f.password_field :password,
placeholder: t('common.forms.auth.password'),
required: true,
class: "form-control" %>
</div>
<div class="form-group">
<%= f.label :password_confirmation, class: "sr-only" %>
<%= f.password_field :password_confirmation, placeholder: "Password confirmation", required: true, class: "form-control" %>
<%= f.password_field :password_confirmation,
placeholder: t('common.forms.auth.password_confirmation'),
required: true,
class: "form-control" %>
</div>
<div class="actions">
<%= f.submit "Sign up", class: "btn btn-dark btn-block" %>
<%= f.submit t('common.forms.auth.sign_up'), class: "btn btn-dark btn-block" %>
</div>
<% end %>

View File

@@ -1,25 +1,33 @@
<%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
<h2>Log in</h2>
<h2><%= t('common.forms.auth.log_in') %></h2>
<div class="form-group">
<%= f.label :email, class: "sr-only" %>
<%= f.email_field :email, autocomplete: "email", placeholder: "Email address", required: true, class: "form-control" %>
<%= f.email_field :email,
autocomplete: "email",
placeholder: t('common.forms.auth.email'),
required: true,
class: "form-control" %>
</div>
<div class="form-group">
<%= f.label :password, class: "sr-only" %>
<%= f.password_field :password, autocomplete: "current-password", placeholder: "Password", required: true, class: "form-control" %>
<%= f.password_field :password,
autocomplete: "current-password",
placeholder: t('common.forms.auth.password'),
required: true,
class: "form-control" %>
</div>
<% if devise_mapping.rememberable? %>
<div class="form-group form-check">
<%= f.check_box :remember_me, class: "form-check-input" %>
<%= f.label :remember_me, class: "form-check-label" %>
<%= f.label t('common.forms.auth.remember_me'), class: "form-check-label" %>
</div>
<% end %>
<div class="actions">
<%= f.submit "Log in", class: "btn btn-dark btn-block" %>
<%= f.submit t('common.forms.auth.log_in'), class: "btn btn-dark btn-block" %>
</div>
<% end %>

View File

@@ -1,22 +1,22 @@
<div class="deviseLinks">
<%- if controller_name != 'sessions' %>
<%= link_to "Log in", new_session_path(resource_name) %>
<%= link_to t('common.forms.auth.log_in'), new_session_path(resource_name) %>
<% end %>
<%- if devise_mapping.registerable? && controller_name != 'registrations' %>
<%= link_to "Sign up", new_registration_path(resource_name) %>
<%= link_to t('common.forms.auth.sign_up'), new_registration_path(resource_name) %>
<% end %>
<%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %>
<%= link_to "Forgot your password?", new_password_path(resource_name) %>
<%= link_to t('common.forms.auth.forgot_password'), new_password_path(resource_name) %>
<% end %>
<%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
<%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %>
<%= link_to t('common.forms.auth.confirmation_instructions_not_received'), new_confirmation_path(resource_name) %>
<% end %>
<%- 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('common.forms.auth.unlock_instructions_not_received'), new_unlock_path(resource_name) %>
<% end %>
<%- if devise_mapping.omniauthable? %>

View File

@@ -1,15 +1,18 @@
<h2>Resend unlock instructions</h2>
<%= form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f| %>
<h2><%= t('common.forms.auth.resend_unlock_instructions') %></h2>
<%= render "devise/shared/error_messages", resource: resource %>
<div class="field">
<%= f.label :email %><br />
<%= f.email_field :email, autofocus: true, autocomplete: "email" %>
<%= f.label :email, class: "sr-only" %><br />
<%= f.email_field :email,
autofocus: true,
autocomplete: "email"
placeholder: t('common.forms.auth.email') %>
</div>
<div class="actions">
<%= f.submit "Resend unlock instructions", class: "btn btn-dark btn-block" %>
<%= f.submit t('common.forms.auth.resend_unlock_instructions'), class: "btn btn-dark btn-block" %>
</div>
<% end %>