From 42d2d0c269a35cc39b4a92ffaa10c96ac8fa957e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Saulo=20Mendon=C3=A7a?= Date: Wed, 25 Oct 2017 21:29:28 -0200 Subject: [PATCH] Add translations and refactor i18n structure --- app/views/home/index.html.erb | 8 ++-- app/views/institutions/index.html.erb | 4 +- .../_table.html.erb | 12 +++--- app/views/jobs/index.html.erb | 2 +- config/locales/pt-BR/general.yml | 21 ++++++++++ config/locales/pt-BR/models/institution.yml | 1 + config/locales/pt-BR/models/job.yml | 14 +++++++ config/locales/pt-BR/models/subscription.yml | 15 +++++++ config/locales/pt-BR/models/user.yml | 10 +++++ config/locales/pt-BR/pt-BR.yml | 39 ------------------- 10 files changed, 74 insertions(+), 52 deletions(-) create mode 100644 config/locales/pt-BR/models/job.yml create mode 100644 config/locales/pt-BR/models/subscription.yml create mode 100644 config/locales/pt-BR/models/user.yml diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb index ac689b2..de5645f 100644 --- a/app/views/home/index.html.erb +++ b/app/views/home/index.html.erb @@ -11,13 +11,13 @@
<%=job.title%>

-

description: <%=job.description%>

+

<%= Job.human_attribute_name(:description) %>: <%=job.description%>


-

requirements: <%=job.requirements%>

+

<%= Job.human_attribute_name(:requirements) %>: <%=job.requirements%>

- Add as favorite - <%= link_to 'Apply for this job', new_job_subscription_path(job) %> + <%=t("actions.add_as_favorite")%> + <%= link_to t("actions.apply_for_this_job"), new_job_subscription_path(job) %>
diff --git a/app/views/institutions/index.html.erb b/app/views/institutions/index.html.erb index e90d6f2..468a877 100644 --- a/app/views/institutions/index.html.erb +++ b/app/views/institutions/index.html.erb @@ -35,10 +35,10 @@ <%= link_to edit_institution_path(institution), class: "btn-floating blue" do %> edit <% end %> - <%= link_to institution, class: "btn btn-floating red", data: { confirm: "Are you sure?" } do %> + <%= link_to institution, class: "btn btn-floating red", data: { confirm: t("messages.are_you_sure") } do %> highlight_remove <% end %> - <%= link_to institution_jobs_path(institution), class: "btn-floating gray", title: "Jobs Posted" do %> + <%= link_to institution_jobs_path(institution), class: "btn-floating gray", title: Job.model_name.human(count: 2) do %> library_books <% end %> diff --git a/app/views/institutions_subscriptions/_table.html.erb b/app/views/institutions_subscriptions/_table.html.erb index 4a4c09f..ee4640c 100644 --- a/app/views/institutions_subscriptions/_table.html.erb +++ b/app/views/institutions_subscriptions/_table.html.erb @@ -2,11 +2,11 @@ - - - - - + + + + + @@ -21,7 +21,7 @@
<%= t('activerecord.models.job') %><%= t('activerecord.models.user') %><%= t('activerecord.attributes.subscription.cover_letter') %><%= t('activerecord.attributes.subscription.created_at') %><%= t('activerecord.attributes.subscription.status') %><%= Job.model_name.human(count: 1) %><%= User.model_name.human(count: 1) %><%= Subscription.human_attribute_name(:cover_letter) %><%= Subscription.human_attribute_name(:created_at) %><%= Subscription.human_attribute_name(:status) %>