Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add translations and refactor i18n structure #45

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions app/views/home/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
<div class="card-content">
<h5><%=job.title%></h5>
<hr>
<p><strong>description: </strong><%=job.description%></p>
<p><strong><%= Job.human_attribute_name(:description) %>: </strong><%=job.description%></p>
<hr>
<p><strong>requirements: </strong><%=job.requirements%></p>
<p><strong><%= Job.human_attribute_name(:requirements) %>: </strong><%=job.requirements%></p>
</div>
<div class="card-action">
<a href="#">Add as favorite</a>
<%= link_to 'Apply for this job', new_job_subscription_path(job) %>
<a href="#"><%=t("actions.add_as_favorite")%></a>
<%= link_to t("actions.apply_for_this_job"), new_job_subscription_path(job) %>
</div>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions app/views/institutions/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@
<%= link_to edit_institution_path(institution), class: "btn-floating blue" do %>
<i class="material-icons">edit</i>
<% 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 %>
<i class="material-icons">highlight_remove</i>
<% 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 %>
<i class="material-icons">library_books</i>
<% end %>
</td>
Expand Down
12 changes: 6 additions & 6 deletions app/views/institutions_subscriptions/_table.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
<table class="bordered highlight centered responsive-table">
<thead>
<tr>
<th><%= t('activerecord.models.job') %></th>
<th><%= t('activerecord.models.user') %></th>
<th><%= t('activerecord.attributes.subscription.cover_letter') %></th>
<th><%= t('activerecord.attributes.subscription.created_at') %></th>
<th><%= t('activerecord.attributes.subscription.status') %></th>
<th><%= Job.model_name.human(count: 1) %></th>
<th><%= User.model_name.human(count: 1) %></th>
<th><%= Subscription.human_attribute_name(:cover_letter) %></th>
<th><%= Subscription.human_attribute_name(:created_at) %></th>
<th><%= Subscription.human_attribute_name(:status) %></th>
</tr>
</thead>
<tbody>
Expand All @@ -21,7 +21,7 @@
</a>
<div id="cover_letter_<%= subscription.id %>" class="modal">
<div class="modal-content">
<h4><%= t('activerecord.attributes.subscription.cover_letter') %></h4>
<h4><%= Subscription.human_attribute_name(:cover_letter) %></h4>
<p><%= subscription.cover_letter %></p>
</div>
<div class="modal-footer">
Expand Down
2 changes: 1 addition & 1 deletion app/views/jobs/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<%= link_to edit_institution_job_path(job.institution, job), class: "btn-floating blue" do %>
<i class="material-icons">edit</i>
<% end %>
<%= link_to institution_job_path(job.institution, job), method: :delete, class: "btn btn-floating red", data: { confirm: "Are you sure?" } do %>
<%= link_to institution_job_path(job.institution, job), method: :delete, class: "btn btn-floating red", data: { confirm: t("messages.are_you_sure") } do %>
<i class="material-icons">highlight_remove</i>
<% end %>
<%= link_to institution_job_path(job.institution, job), class: "btn btn-floating gray" do %>
Expand Down
21 changes: 21 additions & 0 deletions config/locales/pt-BR/general.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,27 @@ pt-BR:
add: Adicionar
edit: Editar
back: Voltar
close: "Fechar"
read: "Ler"
filter: "Filtrar"
approve: "Aprovar"
reject: "Rejeitar"
clear: "Limpar"
next_month: "Próximo mês"
prev_month: "Mês anterior"
select_month: "Selecione um mês"
select_year: "Selecione um ano"
add_as_favorite: "Adicionar aos favoritos"
apply_for_this_job: "Adicionar aos favoritos"

messages:
authorization: "Você não tem autorização para efetuar essa operação"
updated: "Alteração efetuada com sucesso"
error_update: "Não foi possível efetuar a alteração"
to: "até"
today: "Hoje"
are_you_sure: "Você tem certeza?"



institutions:
Expand Down
1 change: 1 addition & 0 deletions config/locales/pt-BR/models/institution.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ pt-BR:
name: "Nome"
description: "Descrição"
category: "Categoria"
created_at: "Data de criação"

14 changes: 14 additions & 0 deletions config/locales/pt-BR/models/job.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
pt-BR:
activerecord:
models:
job:
one: "Trabalho"
other: "Trabalhos"
attributes:
job:
title: "Título"
description: "Descrição"
requirements: "Requerimento"
start_date: "Data de início"
end_date: "Data de Fim"

15 changes: 15 additions & 0 deletions config/locales/pt-BR/models/subscription.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
pt-BR:
activerecord:
models:
subscription:
one: "Inscrição"
other: "Inscrições"
attributes:
subscription:
status: "Status"
created_at: "Data"
cover_letter: "Carta de apresentação"
statuses:
pending: "Pendente"
rejected: "Rejeitado"
approved: "Aprovado"
10 changes: 10 additions & 0 deletions config/locales/pt-BR/models/user.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
pt-BR:
activerecord:
models:
user:
one: "Usuário"
other: "Usuários"
attributes:
user:
email: "E-mail"
name: "Nome"
39 changes: 0 additions & 39 deletions config/locales/pt-BR/pt-BR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,45 +6,6 @@ pt-BR:
restrict_dependent_destroy:
has_one: Não é possível excluir o registro pois existe um %{record} dependente
has_many: Não é possível excluir o registro pois existem %{record} dependentes
models:
user: "Usuário"
subscription: "Inscrição"
job: "Trabalho"
attributes:
user:
email: "E-mail"
name: "Nome"
subscription:
status: "Status"
created_at: "Data"
cover_letter: "Carta de apresentação"
statuses:
pending: "Pendente"
rejected: "Rejeitado"
approved: "Aprovado"
job:
title: "Título"
description: "Descrição"
requirements: "Requerimento"
start_date: "Data de início"
end_date: "Data de Fim"
messages:
authorization: "Você não tem autorização para efetuar essa operação"
updated: "Alteração efetuada com sucesso"
error_update: "Não foi possível efetuar a alteração"
to: "até"
today: "Hoje"
actions:
close: "Fechar"
read: "Ler"
filter: "Filtrar"
approve: "Aprovar"
reject: "Rejeitar"
clear: "Limpar"
next_month: "Próximo mês"
prev_month: "Mês anterior"
select_month: "Selecione um mês"
select_year: "Selecione um ano"
date:
abbr_day_names:
- Dom
Expand Down