Use active model translations for labels

The same way we did for Active Record, but this time we do it for models
not inheriting fom Active Record.
This commit is contained in:
Javi Martín
2019-10-04 18:14:15 +02:00
parent 6fa67b5e53
commit 9ddbd01f91
12 changed files with 34 additions and 33 deletions

View File

@@ -9,14 +9,10 @@
<%= f.select(:document_type, <%= f.select(:document_type,
[[humanize_document_type("1"), 1], [[humanize_document_type("1"), 1],
[humanize_document_type("2"), 2], [humanize_document_type("2"), 2],
[humanize_document_type("3"), 3]], [humanize_document_type("3"), 3]]) %>
label: t("management.document_type_label")) %>
</div> </div>
<div class="small-12 medium-5"> <div class="small-12 medium-5">
<%= f.text_field :document_number, <%= f.text_field :document_number %>
placeholder: t("management.document_number"),
label: t("management.document_number")
%>
</div> </div>
<% if Setting.force_presence_date_of_birth? %> <% if Setting.force_presence_date_of_birth? %>

View File

@@ -12,8 +12,8 @@
<div class="small-12 large-9 small-centered column"> <div class="small-12 large-9 small-centered column">
<%= form_for @letter, url: letter_path, method: :patch do |f| %> <%= form_for @letter, url: letter_path, method: :patch do |f| %>
<%= f.text_field :email, label: t("pages.verify.email"), placeholder: t("pages.verify.email") %> <%= f.text_field :email %>
<%= f.password_field :password, label: t("pages.verify.password"), placeholder: t("pages.verify.password") %> <%= f.password_field :password %>
<p class="letter-divider text-center"> <p class="letter-divider text-center">
<span class="icon-letter"></span> <span class="icon-letter"></span>
@@ -23,7 +23,7 @@
<%= t("pages.verify.info_code") %> <%= t("pages.verify.info_code") %>
</p> </p>
<%= f.text_field :verification_code, label: t("pages.verify.code"), placeholder: t("pages.verify.code") %> <%= f.text_field :verification_code %>
<%= f.submit(class: "button success expanded", value: t("pages.verify.submit")) %> <%= f.submit(class: "button success expanded", value: t("pages.verify.submit")) %>
<% end %> <% end %>

View File

@@ -39,8 +39,7 @@
<div class="row"> <div class="row">
<div class="small-12 medium-8"> <div class="small-12 medium-8">
<div class="small-12 medium-3 column"> <div class="small-12 medium-3 column">
<%= f.select :document_type, document_types, prompt: "", <%= f.select :document_type, document_types, prompt: "" %>
label: t("verification.residence.new.document_type_label") %>
</div> </div>
<div class="small-12 medium-5 column end"> <div class="small-12 medium-5 column end">
@@ -66,13 +65,11 @@
<div class="date-of-birth small-12 medium-6 clear"> <div class="date-of-birth small-12 medium-6 clear">
<%= f.date_select :date_of_birth, <%= f.date_select :date_of_birth,
prompt: true, prompt: true,
start_year: 1900, end_year: minimum_required_age.years.ago.year, start_year: 1900, end_year: minimum_required_age.years.ago.year %>
label: t("verification.residence.new.date_of_birth") %>
</div> </div>
<div class="small-12 medium-5 clear"> <div class="small-12 medium-5 clear">
<%= f.text_field :postal_code, <%= f.text_field :postal_code,
label: t("verification.residence.new.postal_code"),
hint: t("verification.residence.new.postal_code_note") %> hint: t("verification.residence.new.postal_code_note") %>
</div> </div>

View File

@@ -33,7 +33,7 @@
<% end %> <% end %>
<div class="small-12 medium-6"> <div class="small-12 medium-6">
<%= f.text_field :confirmation_code, label: t("verification.sms.edit.confirmation_code") %> <%= f.text_field :confirmation_code %>
</div> </div>
<%= f.submit t("verification.sms.edit.submit_button"), class: "button success" %> <%= f.submit t("verification.sms.edit.submit_button"), class: "button success" %>

View File

@@ -19,6 +19,19 @@ en:
confirmation_code: "Confirmation code" confirmation_code: "Confirmation code"
email: email:
recipient: "Email" recipient: "Email"
verification/letter:
email: "Email"
password: "Password"
verification_code: "Code you received in letter"
verification/management/document:
document_type: "Document type:"
document_number: "Document number"
verification/residence:
date_of_birth: "Date of birth"
document_type: "Document type"
postal_code: "Postcode"
verification/sms:
confirmation_code: "Enter the code you received on your mobile"
officing/residence: officing/residence:
document_type: "Document type" document_type: "Document type"
document_number: "Document number (including letters)" document_number: "Document number (including letters)"

View File

@@ -32,8 +32,6 @@ en:
index: index:
title: Management title: Management
info: Here you can manage users through all actions listed in the left menu. info: Here you can manage users through all actions listed in the left menu.
document_number: Document number
document_type_label: Document type
document_verifications: document_verifications:
already_verified: This user account is already verified. already_verified: This user account is already verified.
has_no_account_html: In order to create an account, go to %{link} and click in <b>"Register"</b> in the upper-left part of the screen. has_no_account_html: In order to create an account, go to %{link} and click in <b>"Register"</b> in the upper-left part of the screen.

View File

@@ -143,10 +143,7 @@ en:
titles: titles:
help: "What is %{org}? - Citizen participation" help: "What is %{org}? - Citizen participation"
verify: verify:
code: Code you received in letter
email: Email
info: "To verify your account introduce your access data:" info: "To verify your account introduce your access data:"
info_code: "Now introduce the code you received in letter:" info_code: "Now introduce the code you received in letter:"
password: Password
submit: Verify my account submit: Verify my account
title: Verify your account title: Verify your account

View File

@@ -47,7 +47,6 @@ en:
new: new:
accept_terms_text: I accept %{terms_url} of the Census accept_terms_text: I accept %{terms_url} of the Census
accept_terms_text_title: I accept the terms and conditions of access of the Census accept_terms_text_title: I accept the terms and conditions of access of the Census
date_of_birth: Date of birth
document_number: Document number document_number: Document number
document_number_help_title: Help document_number_help_title: Help
document_number_help_text_html: "<strong>DNI</strong>: 12345678A<br> <strong>Passport</strong>: AAA000001<br> <strong>Residence card</strong>: X1234567P" document_number_help_text_html: "<strong>DNI</strong>: 12345678A<br> <strong>Passport</strong>: AAA000001<br> <strong>Residence card</strong>: X1234567P"
@@ -55,12 +54,10 @@ en:
passport: Passport passport: Passport
residence_card: Residence card residence_card: Residence card
spanish_id: DNI spanish_id: DNI
document_type_label: Document type
error_not_allowed_age: You don't have the required age to participate error_not_allowed_age: You don't have the required age to participate
error_not_allowed_postal_code: In order to be verified, you must be registered. error_not_allowed_postal_code: In order to be verified, you must be registered.
error_verifying_census: The Census was unable to verify your information. Please confirm that your census details are correct by calling to City Council or visit one Citizen Support Office. error_verifying_census: The Census was unable to verify your information. Please confirm that your census details are correct by calling to City Council or visit one Citizen Support Office.
form_errors: prevented the verification of your residence form_errors: prevented the verification of your residence
postal_code: Postcode
postal_code_note: To verify your account you must be registered postal_code_note: To verify your account you must be registered
terms: the terms and conditions of access terms: the terms and conditions of access
title: Verify residence title: Verify residence
@@ -70,7 +67,6 @@ en:
flash: flash:
success: Enter the confirmation code sent to you by text message success: Enter the confirmation code sent to you by text message
edit: edit:
confirmation_code: Enter the code you received on your mobile
resend_sms_link: Click here to send it again resend_sms_link: Click here to send it again
resend_sms_text: Didn't get a text with your confirmation code? resend_sms_text: Didn't get a text with your confirmation code?
submit_button: Send submit_button: Send

View File

@@ -19,6 +19,19 @@ es:
confirmation_code: "Código de confirmación" confirmation_code: "Código de confirmación"
email: email:
recipient: "Email" recipient: "Email"
verification/letter:
email: "Email"
password: "Contraseña"
verification_code: "Código que has recibido en tu carta"
verification/management/document:
document_type: "Tipo de documento"
document_number: "Número de documento"
verification/residence:
date_of_birth: "Fecha de nacimiento"
document_type: "Tipo de documento"
postal_code: "Código postal"
verification/sms:
confirmation_code: "Introduce el código que has recibido en tu móvil"
officing/residence: officing/residence:
document_type: "Tipo de documento" document_type: "Tipo de documento"
document_number: "Número de documento (incluida letra)" document_number: "Número de documento (incluida letra)"

View File

@@ -32,8 +32,6 @@ es:
index: index:
title: Gestión title: Gestión
info: Desde aquí puedes gestionar usuarios a través de las acciones listadas en el menú de la izquierda. info: Desde aquí puedes gestionar usuarios a través de las acciones listadas en el menú de la izquierda.
document_number: Número de documento
document_type_label: Tipo de documento
document_verifications: document_verifications:
already_verified: Esta cuenta de usuario ya está verificada. already_verified: Esta cuenta de usuario ya está verificada.
has_no_account_html: Para crear un usuario entre en %{link} y haga clic en la opción <b>'Registrarse'</b> en la parte superior derecha de la pantalla. has_no_account_html: Para crear un usuario entre en %{link} y haga clic en la opción <b>'Registrarse'</b> en la parte superior derecha de la pantalla.

View File

@@ -161,10 +161,7 @@ es:
titles: titles:
help: "¿Qué es %{org}? - Participación ciudadana" help: "¿Qué es %{org}? - Participación ciudadana"
verify: verify:
code: Código que has recibido en tu carta
email: Email
info: "Para verificar tu cuenta introduce los datos con los que te registraste:" info: "Para verificar tu cuenta introduce los datos con los que te registraste:"
info_code: "Ahora introduce el código que has recibido en tu carta:" info_code: "Ahora introduce el código que has recibido en tu carta:"
password: Contraseña
submit: Verificar mi cuenta submit: Verificar mi cuenta
title: Verifica tu cuenta title: Verifica tu cuenta

View File

@@ -47,7 +47,6 @@ es:
new: new:
accept_terms_text: Acepto %{terms_url} al Padrón accept_terms_text: Acepto %{terms_url} al Padrón
accept_terms_text_title: Acepto los términos de acceso al Padrón accept_terms_text_title: Acepto los términos de acceso al Padrón
date_of_birth: Fecha de nacimiento
document_number: Número de documento document_number: Número de documento
document_number_help_title: Ayuda document_number_help_title: Ayuda
document_number_help_text_html: "<strong>DNI</strong>: 12345678A<br> <strong>Pasaporte</strong>: AAA000001<br> <strong>Tarjeta de residencia</strong>: X1234567P" document_number_help_text_html: "<strong>DNI</strong>: 12345678A<br> <strong>Pasaporte</strong>: AAA000001<br> <strong>Tarjeta de residencia</strong>: X1234567P"
@@ -55,12 +54,10 @@ es:
passport: Pasaporte passport: Pasaporte
residence_card: Tarjeta de residencia residence_card: Tarjeta de residencia
spanish_id: DNI spanish_id: DNI
document_type_label: Tipo de documento
error_not_allowed_age: No tienes la edad mínima para participar error_not_allowed_age: No tienes la edad mínima para participar
error_not_allowed_postal_code: Para verificarte debes estar empadronado. error_not_allowed_postal_code: Para verificarte debes estar empadronado.
error_verifying_census: El Padrón no pudo verificar tu información. Por favor, confirma que tus datos de empadronamiento sean correctos llamando al Ayuntamiento o visitando una Oficina de Atención al Ciudadano. error_verifying_census: El Padrón no pudo verificar tu información. Por favor, confirma que tus datos de empadronamiento sean correctos llamando al Ayuntamiento o visitando una Oficina de Atención al Ciudadano.
form_errors: evitaron verificar tu residencia form_errors: evitaron verificar tu residencia
postal_code: Código postal
postal_code_note: Para verificar tus datos debes estar empadronado postal_code_note: Para verificar tus datos debes estar empadronado
terms: los términos de acceso terms: los términos de acceso
title: Verificar residencia title: Verificar residencia
@@ -70,7 +67,6 @@ es:
flash: flash:
success: Introduce el código de confirmación que te hemos enviado por mensaje de texto success: Introduce el código de confirmación que te hemos enviado por mensaje de texto
edit: edit:
confirmation_code: Introduce el código que has recibido en tu móvil
resend_sms_link: Solicitar un nuevo código resend_sms_link: Solicitar un nuevo código
resend_sms_text: '¿No has recibido un mensaje de texto con tu código de confirmación?' resend_sms_text: '¿No has recibido un mensaje de texto con tu código de confirmación?'
submit_button: Enviar submit_button: Enviar