Commit 12d1384b2e9f51dedc69dac1c3906004d9cc802c
1 parent
f23b5d32
Exists in
colab
and in
4 other branches
ReadingGroup translations
Showing
15 changed files
with
52 additions
and
24 deletions
Show diff stats
app/views/reading_groups/_form.html.erb
| ... | ... | @@ -21,7 +21,7 @@ |
| 21 | 21 | </div> |
| 22 | 22 | |
| 23 | 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 | 26 | </div> |
| 27 | 27 | <% end %> | ... | ... |
app/views/reading_groups/_no_readings.html.erb
app/views/reading_groups/_reading.html.erb
| ... | ... | @@ -4,10 +4,10 @@ |
| 4 | 4 | <td style="background-color: #<%= reading.color %>; width: 20%;"> </td> |
| 5 | 5 | <% if reading_groups_owner? @reading_group.id %> |
| 6 | 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 | 8 | </td> |
| 9 | 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 | 11 | </td> |
| 12 | 12 | </td> |
| 13 | 13 | <% end %> | ... | ... |
app/views/reading_groups/edit.html.erb
app/views/reading_groups/index.html.erb
| 1 | 1 | <div class="page-header"> |
| 2 | - <h1>Reading Groups</h1> | |
| 2 | + <h1><%= ReadingGroup.model_name.human(count: 2) %></h1> | |
| 3 | 3 | </div> |
| 4 | 4 | |
| 5 | 5 | <% if user_signed_in? %> |
| 6 | 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 | 8 | </p> |
| 9 | 9 | <%else%> |
| 10 | 10 | <p class="alert alert-warning alert-dismissable"> |
| 11 | 11 | <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button> |
| 12 | - You must be logged in to create new Reading Groups. | |
| 12 | + <%= t('unauthenticated', action: t('create', model: ReadingGroup.model_name.human)) %> | |
| 13 | 13 | </p> |
| 14 | 14 | <% end %> |
| 15 | 15 | ... | ... |
app/views/reading_groups/new.html.erb
app/views/reading_groups/show.html.erb
| ... | ... | @@ -3,22 +3,22 @@ |
| 3 | 3 | </div> |
| 4 | 4 | |
| 5 | 5 | <p> |
| 6 | - <strong>Description:</strong> | |
| 6 | + <strong><%= ReadingGroup.human_attribute_name('description') %></strong> | |
| 7 | 7 | <%= @reading_group.description %> |
| 8 | 8 | </p> |
| 9 | 9 | |
| 10 | 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 | 16 | <table class="table table-hover"> |
| 17 | 17 | <thead> |
| 18 | 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 | 22 | </tr> |
| 23 | 23 | </thead> |
| 24 | 24 | |
| ... | ... | @@ -36,6 +36,6 @@ |
| 36 | 36 | |
| 37 | 37 | <p> |
| 38 | 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 | 40 | <% end %> |
| 41 | 41 | </p> | ... | ... |
app/views/shared/_reading_groups_list.erb
| 1 | 1 | <table class="table table-hover"> |
| 2 | 2 | <thead> |
| 3 | 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 | 6 | <th colspan="2"></th> |
| 7 | 7 | </tr> |
| 8 | 8 | </thead> |
| ... | ... | @@ -12,10 +12,10 @@ |
| 12 | 12 | <tr> |
| 13 | 13 | <td><%= reading_group.name %></td> |
| 14 | 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 | 16 | <td> |
| 17 | 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 | 19 | <% end %> |
| 20 | 20 | </td> |
| 21 | 21 | </tr> | ... | ... |
config/locales/views/en.yml
config/locales/views/pt.yml
| ... | ... | @@ -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!' | ... | ... |
| ... | ... | @@ -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 | 14 | \ No newline at end of file | ... | ... |
features/reading_group/create.feature
| ... | ... | @@ -19,7 +19,7 @@ Scenario: Reading Group creation |
| 19 | 19 | Then I should see "My reading group" |
| 20 | 20 | And I should see "New reading group" |
| 21 | 21 | And I should see "New Reading" |
| 22 | - And I should see "Destroy Reading Group" | |
| 22 | + And I should see "Destroy" | |
| 23 | 23 | |
| 24 | 24 | @kalibro_configuration_restart |
| 25 | 25 | Scenario: Reading Group creation with already taken name | ... | ... |
features/reading_group/delete.feature
| ... | ... | @@ -23,6 +23,6 @@ Feature: Reading Group Deletion |
| 23 | 23 | And I am signed in |
| 24 | 24 | And I own a sample reading group |
| 25 | 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 | 27 | Then I should see "New Reading Group" |
| 28 | 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 | 25 | And I should see "New Reading" |
| 26 | 26 | And I should see "Edit" |
| 27 | 27 | And I should see "Destroy" |
| 28 | - And I should see "Destroy Reading Group" | |
| 28 | + And I should see "Destroy" | |
| 29 | 29 | |
| 30 | 30 | @kalibro_configuration_restart |
| 31 | 31 | Scenario: Should show the information of the sample reading | ... | ... |