From 12d1384b2e9f51dedc69dac1c3906004d9cc802c Mon Sep 17 00:00:00 2001 From: Rafael Reggiani Manzo Date: Fri, 20 Mar 2015 12:32:07 -0300 Subject: [PATCH] ReadingGroup translations --- app/views/reading_groups/_form.html.erb | 4 ++-- app/views/reading_groups/_no_readings.html.erb | 2 +- app/views/reading_groups/_reading.html.erb | 4 ++-- app/views/reading_groups/edit.html.erb | 2 +- app/views/reading_groups/index.html.erb | 6 +++--- app/views/reading_groups/new.html.erb | 2 +- app/views/reading_groups/show.html.erb | 14 +++++++------- app/views/shared/_reading_groups_list.erb | 8 ++++---- config/locales/views/en.yml | 1 + config/locales/views/pt.yml | 1 + config/locales/views/reading_group/en.yml | 13 +++++++++++++ config/locales/views/reading_group/pt.yml | 13 +++++++++++++ features/reading_group/create.feature | 2 +- features/reading_group/delete.feature | 2 +- features/reading_group/show.feature | 2 +- 15 files changed, 52 insertions(+), 24 deletions(-) create mode 100644 config/locales/views/reading_group/en.yml create mode 100644 config/locales/views/reading_group/pt.yml diff --git a/app/views/reading_groups/_form.html.erb b/app/views/reading_groups/_form.html.erb index 148969c..b914e9a 100644 --- a/app/views/reading_groups/_form.html.erb +++ b/app/views/reading_groups/_form.html.erb @@ -21,7 +21,7 @@
- <%= f.submit 'Save', class: 'btn btn-primary' %> - <%= link_to 'Back', reading_groups_path, class: 'btn btn-default' %> + <%= f.submit t('save'), class: 'btn btn-primary' %> + <%= link_to t('back'), reading_groups_path, class: 'btn btn-default' %>
<% end %> diff --git a/app/views/reading_groups/_no_readings.html.erb b/app/views/reading_groups/_no_readings.html.erb index 9c8fe8e..d498dc3 100644 --- a/app/views/reading_groups/_no_readings.html.erb +++ b/app/views/reading_groups/_no_readings.html.erb @@ -1,4 +1,4 @@ <% col_number = reading_groups_owner?(@reading_group.id) ? 5 : 3 %> - There are no Readings yet! + <%= t('activemodel.errors.reading_group.no_readings') %> \ No newline at end of file diff --git a/app/views/reading_groups/_reading.html.erb b/app/views/reading_groups/_reading.html.erb index 7415e42..1216d04 100644 --- a/app/views/reading_groups/_reading.html.erb +++ b/app/views/reading_groups/_reading.html.erb @@ -4,10 +4,10 @@   <% if reading_groups_owner? @reading_group.id %> - <%= link_to 'Edit', edit_reading_group_reading_path(@reading_group.id, reading.id), class: 'btn btn-info' %> + <%= link_to t('edit', model: ''), edit_reading_group_reading_path(@reading_group.id, reading.id), class: 'btn btn-info' %> - <%= link_to 'Destroy', reading_group_reading_path(@reading_group.id, reading.id), method: :delete, data: { confirm: 'Are you sure that you want to destroy this Reading?' }, class: 'btn btn-danger' %> + <%= link_to t('destroy'), reading_group_reading_path(@reading_group.id, reading.id), method: :delete, data: { confirm: t('sure_destroy', model: Reading.model_name.human) }, class: 'btn btn-danger' %> <% end %> diff --git a/app/views/reading_groups/edit.html.erb b/app/views/reading_groups/edit.html.erb index 919e097..aedec64 100644 --- a/app/views/reading_groups/edit.html.erb +++ b/app/views/reading_groups/edit.html.erb @@ -1,5 +1,5 @@ <%= render 'form' %> \ No newline at end of file diff --git a/app/views/reading_groups/index.html.erb b/app/views/reading_groups/index.html.erb index 92ba227..eca056c 100644 --- a/app/views/reading_groups/index.html.erb +++ b/app/views/reading_groups/index.html.erb @@ -1,15 +1,15 @@ <% if user_signed_in? %>

- <%= link_to 'New Reading Group', new_reading_group_path, class: 'btn btn-primary' %> + <%= link_to "#{t('new.male')} #{ReadingGroup.model_name.human}", new_reading_group_path, class: 'btn btn-primary' %>

<%else%>

- You must be logged in to create new Reading Groups. + <%= t('unauthenticated', action: t('create', model: ReadingGroup.model_name.human)) %>

<% end %> diff --git a/app/views/reading_groups/new.html.erb b/app/views/reading_groups/new.html.erb index c619475..05aa510 100644 --- a/app/views/reading_groups/new.html.erb +++ b/app/views/reading_groups/new.html.erb @@ -1,5 +1,5 @@ <%= render 'form' %> diff --git a/app/views/reading_groups/show.html.erb b/app/views/reading_groups/show.html.erb index 87b6e53..4400cf6 100644 --- a/app/views/reading_groups/show.html.erb +++ b/app/views/reading_groups/show.html.erb @@ -3,22 +3,22 @@

- Description: + <%= ReadingGroup.human_attribute_name('description') %> <%= @reading_group.description %>


-

Readings

+

<%= Reading.model_name.human(count: 2) %>

-<% if reading_groups_owner? @reading_group.id %><%= link_to 'New Reading', new_reading_group_reading_path(@reading_group,), class: 'btn btn-primary' %><% end %> +<% if reading_groups_owner? @reading_group.id %><%= link_to "#{t('new.female')} #{Reading.model_name.human}", new_reading_group_reading_path(@reading_group,), class: 'btn btn-primary' %><% end %> - - - + + + @@ -36,6 +36,6 @@

<% if reading_groups_owner? @reading_group.id %> - <%= link_to 'Destroy Reading Group', reading_group_path(@reading_group.id), method: :delete, data: { confirm: 'Are you sure that you want to destroy this Reading Group?' }, class: 'btn btn-danger' %> + <%= link_to t('destroy'), reading_group_path(@reading_group.id), method: :delete, data: { confirm: t('sure_destroy', model: ReadingGroup.model_name.human) }, class: 'btn btn-danger' %> <% end %>

diff --git a/app/views/shared/_reading_groups_list.erb b/app/views/shared/_reading_groups_list.erb index c5147fc..c34066d 100644 --- a/app/views/shared/_reading_groups_list.erb +++ b/app/views/shared/_reading_groups_list.erb @@ -1,8 +1,8 @@
LabelGradeColor<%= Reading.human_attribute_name('label') %><%= Reading.human_attribute_name('grade') %><%= Reading.human_attribute_name('color') %>
- - + + @@ -12,10 +12,10 @@ - + diff --git a/config/locales/views/en.yml b/config/locales/views/en.yml index 98db633..bd9a7d8 100644 --- a/config/locales/views/en.yml +++ b/config/locales/views/en.yml @@ -101,6 +101,7 @@ en: female: 'New' create: 'Create %{model}' add: 'Add' + sure_destroy: 'Are you sure that you want to destroy this %{model}?' #this pattern is type_folder_file about_mezuro: "About Mezuro" diff --git a/config/locales/views/pt.yml b/config/locales/views/pt.yml index 31fed31..60b8587 100644 --- a/config/locales/views/pt.yml +++ b/config/locales/views/pt.yml @@ -101,6 +101,7 @@ pt: female: 'Nova' create: 'Criar %{model}' add: 'Adicionar' + sure_destroy: 'Você tem certeza que deseja apagar este(a) %{model}?' #this pattern is type_folder_file diff --git a/config/locales/views/reading_group/en.yml b/config/locales/views/reading_group/en.yml new file mode 100644 index 0000000..dda0de8 --- /dev/null +++ b/config/locales/views/reading_group/en.yml @@ -0,0 +1,13 @@ +en: + activemodel: + models: + reading_group: + one: Reading Group + other: Reading Groups + attributes: + reading_group: + name: 'Name' + description: 'Description' + errors: + reading_group: + no_readings: 'There are no Readings yet!' diff --git a/config/locales/views/reading_group/pt.yml b/config/locales/views/reading_group/pt.yml new file mode 100644 index 0000000..0096018 --- /dev/null +++ b/config/locales/views/reading_group/pt.yml @@ -0,0 +1,13 @@ +pt: + activemodel: + models: + reading_group: + one: Grupo de Leitura + other: Grupos de Leitura + attributes: + reading_group: + name: 'Nome' + description: 'Descrição' + errors: + reading_group: + no_readings: 'Ainda não existem Leituras!' \ No newline at end of file diff --git a/features/reading_group/create.feature b/features/reading_group/create.feature index 110067d..999c2fc 100644 --- a/features/reading_group/create.feature +++ b/features/reading_group/create.feature @@ -19,7 +19,7 @@ Scenario: Reading Group creation Then I should see "My reading group" And I should see "New reading group" And I should see "New Reading" - And I should see "Destroy Reading Group" + And I should see "Destroy" @kalibro_configuration_restart Scenario: Reading Group creation with already taken name diff --git a/features/reading_group/delete.feature b/features/reading_group/delete.feature index 696dfe7..11f9560 100644 --- a/features/reading_group/delete.feature +++ b/features/reading_group/delete.feature @@ -23,6 +23,6 @@ Feature: Reading Group Deletion And I am signed in And I own a sample reading group And I visit the Sample Reading Group page - When I click the Destroy Reading Group link + When I click the Destroy link Then I should see "New Reading Group" And the Sample Reading Group should not be there diff --git a/features/reading_group/show.feature b/features/reading_group/show.feature index daf7b27..00d8840 100644 --- a/features/reading_group/show.feature +++ b/features/reading_group/show.feature @@ -25,7 +25,7 @@ Scenario: Should show the links for the user that owns the reading group And I should see "New Reading" And I should see "Edit" And I should see "Destroy" - And I should see "Destroy Reading Group" + And I should see "Destroy" @kalibro_configuration_restart Scenario: Should show the information of the sample reading -- libgit2 0.21.2
NameDescription<%= ReadingGroup.human_attribute_name('name') %><%= ReadingGroup.human_attribute_name('description') %>
<%= reading_group.name %> <%= reading_group.description %><%= link_to 'Show', reading_group_path(reading_group.id), class: 'btn btn-info' %><%= link_to t('show'), reading_group_path(reading_group.id), class: 'btn btn-info' %> <% if reading_groups_owner? reading_group.id %> - <%= link_to 'Edit', edit_reading_group_path(reading_group.id), class: 'btn btn-info' %> + <%= link_to t('edit', model: ''), edit_reading_group_path(reading_group.id), class: 'btn btn-info' %> <% end %>