Commit 12d1384b2e9f51dedc69dac1c3906004d9cc802c

Authored by Rafael Manzo
1 parent f23b5d32

ReadingGroup translations

app/views/reading_groups/_form.html.erb
@@ -21,7 +21,7 @@ @@ -21,7 +21,7 @@
21 </div> 21 </div>
22 22
23 <div class="row margin-left-none" style="margin-top: 20px"> 23 <div class="row margin-left-none" style="margin-top: 20px">
24 - <%= f.submit 'Save', class: 'btn btn-primary' %>  
25 - <%= link_to 'Back', reading_groups_path, class: 'btn btn-default' %> 24 + <%= f.submit t('save'), class: 'btn btn-primary' %>
  25 + <%= link_to t('back'), reading_groups_path, class: 'btn btn-default' %>
26 </div> 26 </div>
27 <% end %> 27 <% end %>
app/views/reading_groups/_no_readings.html.erb
1 <tr> 1 <tr>
2 <% col_number = reading_groups_owner?(@reading_group.id) ? 5 : 3 %> 2 <% col_number = reading_groups_owner?(@reading_group.id) ? 5 : 3 %>
3 - <td colspan="<%= col_number %>">There are no Readings yet!</td> 3 + <td colspan="<%= col_number %>"><%= t('activemodel.errors.reading_group.no_readings') %></td>
4 </tr> 4 </tr>
5 \ No newline at end of file 5 \ No newline at end of file
app/views/reading_groups/_reading.html.erb
@@ -4,10 +4,10 @@ @@ -4,10 +4,10 @@
4 <td style="background-color: #<%= reading.color %>; width: 20%;">&nbsp;</td> 4 <td style="background-color: #<%= reading.color %>; width: 20%;">&nbsp;</td>
5 <% if reading_groups_owner? @reading_group.id %> 5 <% if reading_groups_owner? @reading_group.id %>
6 <td> 6 <td>
7 - <%= link_to 'Edit', edit_reading_group_reading_path(@reading_group.id, reading.id), class: 'btn btn-info' %> 7 + <%= link_to t('edit', model: ''), edit_reading_group_reading_path(@reading_group.id, reading.id), class: 'btn btn-info' %>
8 </td> 8 </td>
9 <td> 9 <td>
10 - <%= 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' %> 10 + <%= 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' %>
11 </td> 11 </td>
12 </td> 12 </td>
13 <% end %> 13 <% end %>
app/views/reading_groups/edit.html.erb
1 <div class="page-header"> 1 <div class="page-header">
2 - <h1>Edit Reading Group</h1> 2 + <h1><%= t('edit', model: ReadingGroup.model_name.human) %></h1>
3 </div> 3 </div>
4 4
5 <%= render 'form' %> 5 <%= render 'form' %>
6 \ No newline at end of file 6 \ No newline at end of file
app/views/reading_groups/index.html.erb
1 <div class="page-header"> 1 <div class="page-header">
2 - <h1>Reading Groups</h1> 2 + <h1><%= ReadingGroup.model_name.human(count: 2) %></h1>
3 </div> 3 </div>
4 4
5 <% if user_signed_in? %> 5 <% if user_signed_in? %>
6 <p> 6 <p>
7 - <%= link_to 'New Reading Group', new_reading_group_path, class: 'btn btn-primary' %> 7 + <%= link_to "#{t('new.male')} #{ReadingGroup.model_name.human}", new_reading_group_path, class: 'btn btn-primary' %>
8 </p> 8 </p>
9 <%else%> 9 <%else%>
10 <p class="alert alert-warning alert-dismissable"> 10 <p class="alert alert-warning alert-dismissable">
11 <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button> 11 <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
12 - You must be logged in to create new Reading Groups. 12 + <%= t('unauthenticated', action: t('create', model: ReadingGroup.model_name.human)) %>
13 </p> 13 </p>
14 <% end %> 14 <% end %>
15 15
app/views/reading_groups/new.html.erb
1 <div class="page-header"> 1 <div class="page-header">
2 - <h1>New Reading Group</h1> 2 + <h1><%= "#{t('new.male')} #{ReadingGroup.model_name.human}" %></h1>
3 </div> 3 </div>
4 4
5 <%= render 'form' %> 5 <%= render 'form' %>
app/views/reading_groups/show.html.erb
@@ -3,22 +3,22 @@ @@ -3,22 +3,22 @@
3 </div> 3 </div>
4 4
5 <p> 5 <p>
6 - <strong>Description:</strong> 6 + <strong><%= ReadingGroup.human_attribute_name('description') %></strong>
7 <%= @reading_group.description %> 7 <%= @reading_group.description %>
8 </p> 8 </p>
9 9
10 <hr /> 10 <hr />
11 11
12 -<h2>Readings</h2> 12 +<h2><%= Reading.model_name.human(count: 2) %></h2>
13 13
14 -<% if reading_groups_owner? @reading_group.id %><%= link_to 'New Reading', new_reading_group_reading_path(@reading_group,), class: 'btn btn-primary' %><% end %> 14 +<% 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 %>
15 15
16 <table class="table table-hover"> 16 <table class="table table-hover">
17 <thead> 17 <thead>
18 <tr> 18 <tr>
19 - <th>Label</th>  
20 - <th>Grade</th>  
21 - <th>Color</th> 19 + <th><%= Reading.human_attribute_name('label') %></th>
  20 + <th><%= Reading.human_attribute_name('grade') %></th>
  21 + <th><%= Reading.human_attribute_name('color') %></th>
22 </tr> 22 </tr>
23 </thead> 23 </thead>
24 24
@@ -36,6 +36,6 @@ @@ -36,6 +36,6 @@
36 36
37 <p> 37 <p>
38 <% if reading_groups_owner? @reading_group.id %> 38 <% if reading_groups_owner? @reading_group.id %>
39 - <%= 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' %> 39 + <%= 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' %>
40 <% end %> 40 <% end %>
41 </p> 41 </p>
app/views/shared/_reading_groups_list.erb
1 <table class="table table-hover"> 1 <table class="table table-hover">
2 <thead> 2 <thead>
3 <tr> 3 <tr>
4 - <th>Name</th>  
5 - <th>Description</th> 4 + <th><%= ReadingGroup.human_attribute_name('name') %></th>
  5 + <th><%= ReadingGroup.human_attribute_name('description') %></th>
6 <th colspan="2"></th> 6 <th colspan="2"></th>
7 </tr> 7 </tr>
8 </thead> 8 </thead>
@@ -12,10 +12,10 @@ @@ -12,10 +12,10 @@
12 <tr> 12 <tr>
13 <td><%= reading_group.name %></td> 13 <td><%= reading_group.name %></td>
14 <td><%= reading_group.description %></td> 14 <td><%= reading_group.description %></td>
15 - <td><%= link_to 'Show', reading_group_path(reading_group.id), class: 'btn btn-info' %></td> 15 + <td><%= link_to t('show'), reading_group_path(reading_group.id), class: 'btn btn-info' %></td>
16 <td> 16 <td>
17 <% if reading_groups_owner? reading_group.id %> 17 <% if reading_groups_owner? reading_group.id %>
18 - <%= link_to 'Edit', edit_reading_group_path(reading_group.id), class: 'btn btn-info' %> 18 + <%= link_to t('edit', model: ''), edit_reading_group_path(reading_group.id), class: 'btn btn-info' %>
19 <% end %> 19 <% end %>
20 </td> 20 </td>
21 </tr> 21 </tr>
config/locales/views/en.yml
@@ -101,6 +101,7 @@ en: @@ -101,6 +101,7 @@ en:
101 female: 'New' 101 female: 'New'
102 create: 'Create %{model}' 102 create: 'Create %{model}'
103 add: 'Add' 103 add: 'Add'
  104 + sure_destroy: 'Are you sure that you want to destroy this %{model}?'
104 #this pattern is type_folder_file 105 #this pattern is type_folder_file
105 106
106 about_mezuro: "About Mezuro" 107 about_mezuro: "About Mezuro"
config/locales/views/pt.yml
@@ -101,6 +101,7 @@ pt: @@ -101,6 +101,7 @@ pt:
101 female: 'Nova' 101 female: 'Nova'
102 create: 'Criar %{model}' 102 create: 'Criar %{model}'
103 add: 'Adicionar' 103 add: 'Adicionar'
  104 + sure_destroy: 'Você tem certeza que deseja apagar este(a) %{model}?'
104 105
105 #this pattern is type_folder_file 106 #this pattern is type_folder_file
106 107
config/locales/views/reading_group/en.yml 0 → 100644
@@ -0,0 +1,13 @@ @@ -0,0 +1,13 @@
  1 +en:
  2 + activemodel:
  3 + models:
  4 + reading_group:
  5 + one: Reading Group
  6 + other: Reading Groups
  7 + attributes:
  8 + reading_group:
  9 + name: 'Name'
  10 + description: 'Description'
  11 + errors:
  12 + reading_group:
  13 + no_readings: 'There are no Readings yet!'
config/locales/views/reading_group/pt.yml 0 → 100644
@@ -0,0 +1,13 @@ @@ -0,0 +1,13 @@
  1 +pt:
  2 + activemodel:
  3 + models:
  4 + reading_group:
  5 + one: Grupo de Leitura
  6 + other: Grupos de Leitura
  7 + attributes:
  8 + reading_group:
  9 + name: 'Nome'
  10 + description: 'Descrição'
  11 + errors:
  12 + reading_group:
  13 + no_readings: 'Ainda não existem Leituras!'
0 \ No newline at end of file 14 \ No newline at end of file
features/reading_group/create.feature
@@ -19,7 +19,7 @@ Scenario: Reading Group creation @@ -19,7 +19,7 @@ Scenario: Reading Group creation
19 Then I should see "My reading group" 19 Then I should see "My reading group"
20 And I should see "New reading group" 20 And I should see "New reading group"
21 And I should see "New Reading" 21 And I should see "New Reading"
22 - And I should see "Destroy Reading Group" 22 + And I should see "Destroy"
23 23
24 @kalibro_configuration_restart 24 @kalibro_configuration_restart
25 Scenario: Reading Group creation with already taken name 25 Scenario: Reading Group creation with already taken name
features/reading_group/delete.feature
@@ -23,6 +23,6 @@ Feature: Reading Group Deletion @@ -23,6 +23,6 @@ Feature: Reading Group Deletion
23 And I am signed in 23 And I am signed in
24 And I own a sample reading group 24 And I own a sample reading group
25 And I visit the Sample Reading Group page 25 And I visit the Sample Reading Group page
26 - When I click the Destroy Reading Group link 26 + When I click the Destroy link
27 Then I should see "New Reading Group" 27 Then I should see "New Reading Group"
28 And the Sample Reading Group should not be there 28 And the Sample Reading Group should not be there
features/reading_group/show.feature
@@ -25,7 +25,7 @@ Scenario: Should show the links for the user that owns the reading group @@ -25,7 +25,7 @@ Scenario: Should show the links for the user that owns the reading group
25 And I should see "New Reading" 25 And I should see "New Reading"
26 And I should see "Edit" 26 And I should see "Edit"
27 And I should see "Destroy" 27 And I should see "Destroy"
28 - And I should see "Destroy Reading Group" 28 + And I should see "Destroy"
29 29
30 @kalibro_configuration_restart 30 @kalibro_configuration_restart
31 Scenario: Should show the information of the sample reading 31 Scenario: Should show the information of the sample reading