Commit dec710ee9c9176350f8fa2eea38797f7ab734dd7

Authored by Heitor
Committed by Rafael Manzo
1 parent bd71002c

Added translations to compound metric configuration views

Signed off by: Daniel Alves <danpaulalves@gmail.com>
app/views/compound_metric_configurations/_created_metrics.html.erb
1 1 <div id="created-metrics-accordion">
2   - <h3 class="jquery-ui-accordion"> Created Metrics </h3>
  2 + <h3 class="jquery-ui-accordion"> <%= t('created_metrics') %> </h3>
3 3 <div>
4 4 <table class="table table-hover">
5 5 <thead>
6   - <th>Name</th>
7   - <th>Code</th>
  6 + <th> <%= t('name') %> </th>
  7 + <th> <%= t('code') %> </th>
8 8 </thead>
9 9 <tbody>
10 10 <%= render partial: 'created_metric', collection: metric_configurations, as: 'metric_configuration' %>
11 11 </tbody>
12 12 </table>
13 13 </div>
14   -</div>
15 14 \ No newline at end of file
  15 +</div>
... ...
app/views/compound_metric_configurations/_form.html.erb
... ... @@ -13,7 +13,7 @@
13 13 </div>
14 14 <div class="help-container">
15 15 <p>
16   - It is used to calculate the weighted average of a <%= link_to 'module', tutorials_path("keywords", anchor: "module")%>'s grade.
  16 + <%= t('calculate_weighted_average') %> <%= link_to t('module'), tutorials_path("keywords", anchor: "module")%> <%= t('grades_belonging_to_a_module') %>
17 17 </p>
18 18 </div>
19 19 </div>
... ... @@ -25,19 +25,19 @@
25 25 <% else %>
26 26 <div class="form-row">
27 27 <div class="field-container">
28   - <%= f.label :reading_group_id, 'Reading Group', class: 'control-label' %>
  28 + <%= f.label :reading_group_id, t('reading_group'), class: 'control-label' %>
29 29 <%= f.select( :reading_group_id, reading_group_options, {class: 'form-control'} ) %>
30 30 </div>
31 31 <div class="help-container">
32 32 <p>
33   - The <%= link_to 'Reading Group', tutorials_path('keywords', anchor: 'reading_group') %> associated with this metric.
  33 + <%= t('the') %> <%= link_to t('reading_group'), tutorials_path('keywords', anchor: 'reading_group') %> <%= t('associated_metric_configuration_form') %>
34 34 </p>
35 35 </div>
36 36 </div>
37 37 <%= f.hidden_field(:kalibro_configuration_id, value: @kalibro_configuration_id) %>
38   - <%= link_to 'Back', kalibro_configuration_path(@kalibro_configuration_id), class: 'btn btn-default' %>
  38 + <%= link_to t('back'), kalibro_configuration_path(@kalibro_configuration_id), class: 'btn btn-default' %>
39 39 <% end %>
40 40 </div>
41 41 </div>
42 42 <br>
43   -<%= f.submit 'Save', class: 'btn btn-primary' %>
  43 +<%= f.submit t('save'), class: 'btn btn-primary' %>
... ...
app/views/compound_metric_configurations/_metric_options.html.erb
... ... @@ -5,7 +5,7 @@
5 5 </div>
6 6 <div class="help-container">
7 7 <p>
8   - A custom name for your compound metric.
  8 + <%= t('body1_compound_metric_options') %>
9 9 </p>
10 10 </div>
11 11 </div>
... ... @@ -17,7 +17,7 @@
17 17 </div>
18 18 <div class="help-container">
19 19 <p>
20   - A short description of your compound metric.
  20 + <%= t('body2_compound_metric_options') %>
21 21 </p>
22 22 </div>
23 23 </div>
... ... @@ -29,7 +29,7 @@
29 29 </div>
30 30 <div class="help-container">
31 31 <p>
32   - A mathematical expression (in javascript) to calculate your compound metric. It needs a return statement. The codes of already created metrics can be used inside the script.
  32 + <%= t('body3_compound_metric_options') %>
33 33 </p>
34 34 </div>
35 35 </div>
... ... @@ -41,7 +41,7 @@
41 41 </div>
42 42 <div class="help-container">
43 43 <p>
44   - The <%= link_to 'granularity', tutorials_path("keywords", anchor: "granularity")%> of the <%= link_to 'modules', tutorials_path("keywords", anchor: "module")%> measured by this metric.
  44 + <%= t('the') %> <%= link_to t('granularity'), tutorials_path('keywords', anchor: "granularity")%> <%= t('of_the') %> <%= link_to t('modules'), tutorials_path( 'keywords', anchor: 'module' )%> <%= t('measured_metric') %>
45 45 </p>
46 46 </div>
47 47 </div>
... ...
app/views/compound_metric_configurations/edit.html.erb
1 1 <div class="page-header">
2   - <h1>Edit Compound Metric Configuration</h1>
3   -</div>
  2 + <h1> <%= t('title_compound_edit') %> </h1>
  3 +</div
4 4  
5 5 <%= render partial: 'created_metrics', locals: {metric_configurations: @metric_configurations} %>
6 6  
... ...
app/views/compound_metric_configurations/new.html.erb
1 1 <div class="page-header">
2   - <h1>New Compound Metric Configuration</h1>
  2 + <h1> <%= t('title_compound_new') %> </h1>
3 3 </div>
4 4  
5 5 <%= render partial: 'created_metrics', locals: {metric_configurations: @metric_configurations} %>
... ...
app/views/compound_metric_configurations/show.html.erb
... ... @@ -3,58 +3,58 @@
3 3 </div>
4 4  
5 5 <p>
6   - <strong>Description:</strong>
  6 + <strong> <%= t('description') %>:</strong>
7 7 <% if @compound_metric_configuration.metric.description.nil? %>
8   - <%= "There is no description available." %>
  8 + <%= t('no_description') %>
9 9 <% else %>
10 10 <%= @compound_metric_configuration.metric.description %>
11 11 <% end %>
12 12 </p>
13 13  
14 14 <p>
15   - <strong>Script:</strong>
  15 + <strong> <%= t('script') %>:</strong>
16 16 <%= @compound_metric_configuration.metric.script %>
17 17 </p>
18 18  
19 19 <p>
20   - <strong>Scope:</strong>
  20 + <strong> <%= t('scope') %>:</strong>
21 21 <%= @compound_metric_configuration.metric.scope %>
22 22 </p>
23 23  
24 24 <p>
25   - <strong>Code:</strong>
  25 + <strong> <%= t('code') %>:</strong>
26 26 <%= @compound_metric_configuration.metric.code %>
27 27 </p>
28 28  
29 29 <p>
30   - <strong>Weight:</strong>
  30 + <strong> <%= t('weight') %>:</strong>
31 31 <%= @compound_metric_configuration.weight %>
32 32 </p>
33 33  
34 34 <p>
35   - <strong>Aggregation Form:</strong>
  35 + <strong> <%= t('metric_configurations_aggregation') %>:</strong>
36 36 <%= @compound_metric_configuration.aggregation_form %>
37 37 </p>
38 38  
39 39 <p>
40   - <strong>Reading Group Name:</strong>
  40 + <strong> <%= t('metric_configurations_reading_group') %>:</strong>
41 41 <%= @reading_group.name %>
42 42 </p>
43 43  
44 44 <hr>
45 45  
46   -<h2> Ranges </h2>
  46 +<h2> <%= t('ranges') %> </h2>
47 47 <% if kalibro_configuration_owner? @compound_metric_configuration.kalibro_configuration_id %>
48   - <%= link_to 'Add Range', kalibro_configuration_metric_configuration_new_kalibro_range_path(@compound_metric_configuration.kalibro_configuration_id,
  48 + <%= link_to t('add_range'), kalibro_configuration_metric_configuration_new_kalibro_range_path(@compound_metric_configuration.kalibro_configuration_id,
49 49 @compound_metric_configuration.id), class: 'btn btn-info' %>
50 50 <% end %>
51 51  
52 52 <table class="table table-hover">
53 53 <thead>
54 54 <tr>
55   - <th>Label</th>
56   - <th>Beginning</th>
57   - <th>End</th>
  55 + <th> <%= t('label') %> </th>
  56 + <th> <%= t('beginning') %> </th>
  57 + <th> <%= t('end') %> </th>
58 58 </tr>
59 59 </thead>
60 60 <tbody>
... ... @@ -69,10 +69,10 @@
69 69 <hr>
70 70  
71 71 <p>
72   - <%= link_to 'Back', kalibro_configuration_path(@compound_metric_configuration.kalibro_configuration_id), class: 'btn btn-default' %>
  72 + <%= link_to t('back'), kalibro_configuration_path(@compound_metric_configuration.kalibro_configuration_id), class: 'btn btn-default' %>
73 73 <% if kalibro_configuration_owner? @compound_metric_configuration.kalibro_configuration_id %>
74   - <%= link_to 'Destroy Metric Configuration', kalibro_configuration_metric_configuration_path(@compound_metric_configuration.kalibro_configuration_id,
75   - @compound_metric_configuration.id), method: :delete, data: { confirm: 'Are you sure that you want to destroy this Metric Configuration?' },
  74 + <%= link_to t('destroy_metric_configuration'), kalibro_configuration_metric_configuration_path(@compound_metric_configuration.kalibro_configuration_id,
  75 + @compound_metric_configuration.id), method: :delete, data: { confirm: t('sure_destroy_metric_configuration') },
76 76 class: 'btn btn-danger' %>
77 77 <% end %>
78 78 </p>
... ...
config/application.rb
... ... @@ -17,7 +17,8 @@ module Mezuro
17 17 # config.time_zone = 'Central Time (US & Canada)'
18 18  
19 19 # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
20   - # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
  20 + config.i18n.load_path += Dir[Rails.root.join('config', 'locales/views', '*.{rb,yml}').to_s]
  21 + config.i18n.load_path += Dir[Rails.root.join('config', 'locales/controllers', '*.{rb,yml}').to_s]
21 22 # config.i18n.default_locale = :de
22 23 config.i18n.enforce_available_locales = true
23 24  
... ...
config/locales/views/en.yml
... ... @@ -35,8 +35,8 @@ en:
35 35 and: "and"
36 36 name: "Name"
37 37 label: "Label"
38   - scope: "Scope:"
39   - code: "Code:"
  38 + scope: "Scope"
  39 + code: "Code"
40 40 reading_group: "Reading Group"
41 41 reading_groups: "Reading Groups"
42 42 project: "Project"
... ... @@ -45,7 +45,7 @@ en:
45 45 configurations: "Configurations"
46 46 edit_account: "Edit Account"
47 47 module: "Module"
48   - weight: "Weight:"
  48 + weight: "Weight"
49 49 description: "Description"
50 50 beginning: "Beginning"
51 51 ranges: "Ranges"
... ... @@ -62,7 +62,7 @@ en:
62 62 repositories: "Repositories"
63 63 type: "Type"
64 64 address: "Address"
65   - script: "Script:"
  65 + script: "Script"
66 66 add_range: "Add Range"
67 67 back: "Back"
68 68 destroy: "Destroy"
... ... @@ -130,8 +130,8 @@ en:
130 130 metric_configuration_name: "Metric Name:"
131 131 metric_configurations_description: "Metric Description:"
132 132 metric_configurations_base_tool_name: "Base Tool Name:"
133   - metric_configurations_aggregation: "Aggregation Form:"
134   - metric_configurations_reading_group: "Reading Group Name:"
  133 + metric_configurations_aggregation: "Aggregation Form"
  134 + metric_configurations_reading_group: "Reading Group Name"
135 135 created_metrics: "Created Metrics"
136 136 resend_instruction: "Resend confirmation instructions"
137 137 confirm_account_email: "You can confirm your account email through the link below:"
... ... @@ -155,14 +155,15 @@ en:
155 155 reset_it: "to reset it."
156 156 stay_logged: "Stay logged in."
157 157 resend_unclok_instructions: "Resend unlock instructions"
158   - grade: "'s Grade."
  158 + grade: "Grade"
  159 + grades_belonging_to_a_module: "'s Grades"
159 160 edit_configuration: "Edit Configuration"
160 161 must_logged_configuration: "You must be logged in to create new Configurations."
161 162 new_configuration: "New Configuration"
162 163 measured_metric: "measured by this metric."
163 164 change_password: "Change your password "
164 165 no_metric_configurations: "There are no Metric Configurations yet!"
165   - calculate_weighted_average: "It is used to calculate the weighted average of a "
  166 + calculate_weighted_average: "It is used to calculate the weighted average of the "
166 167 range_lower_limit: "This Range's lower limit."
167 168 range_upper_limit: "This Range's upper limit."
168 169 explanation_chose_interval: "An explanation of why you chose this interval, with that reading for this"
... ...
config/locales/views/pt.yml
... ... @@ -30,11 +30,11 @@ pt:
30 30 edit: "Editar"
31 31 edit_user: "Editar Usuário"
32 32 end: "Fim"
33   - the: "a"
34   - of_the: "do"
  33 + the: "A"
  34 + of_the: "dos"
35 35 and: "e"
36 36 name: "Nome"
37   - label: "Legenda"
  37 + label: "Rótulo"
38 38 scope: "Escopo"
39 39 code: "Código"
40 40 reading_group: "Grupo de Leitura"
... ... @@ -45,7 +45,7 @@ pt:
45 45 configurations: "Configurações"
46 46 edit_account: "Editar Conta"
47 47 module: "Módulo"
48   - weight: "Peso:"
  48 + weight: "Peso"
49 49 description: "Descrição"
50 50 beginning: "Início"
51 51 range: "Intervalo"
... ... @@ -62,8 +62,8 @@ pt:
62 62 repositories: "Repositórios"
63 63 type: "Tipo"
64 64 address: "Endereço"
65   - script: "Script:"
66   - add_range: "Adicionando Intervalo"
  65 + script: "Script"
  66 + add_range: "Adicionar Intervalo"
67 67 back: "Voltar"
68 68 destroy: "Destruir"
69 69 save: "Salvar"
... ... @@ -112,9 +112,9 @@ pt:
112 112 body2_compound_form: " <p>Ele é usado para calcular a média ponderada de um"
113 113 body1_compound_metric_options: "Um nome personalizado para a sua métrica composta."
114 114 body2_compound_metric_options: "Uma breve descrição de sua métrica composta."
115   - body3_compound_metric_options: "A expressão matemática (em javascript) para calcular a sua métrica composta. Ela precisa de uma instrução de retorno. Os códigos de métricas já criados podem ser usados ​​dentro do script. "
116   - title_compound_edit: "Editar métrica composta de configuração"
117   - title_compound_new: "Nova métrica composta de configuração"
  115 + body3_compound_metric_options: "A expressão matemática (em javascript) para calcular a sua métrica composta. Ela precisa de uma instrução de retorno (por exemplo, 'return resultado;'). Os códigos de métricas já criadas podem ser usados dentro do script."
  116 + title_compound_edit: "Editar Configuração de Métrica Composta"
  117 + title_compound_new: "Nova Configuração de Métrica Composta"
118 118 weighted_average_metric_configurations_form: "Ele é usado para calcular a média ponderada de um"
119 119 statistical_result_metric_configurations_form: "É o cálculo dos resultados estatísticos para maior"
120 120 modules_eg_metric_configurations_form: "módulos (por exemplo, as linhas médias de código das classes dentro de um pacote)."
... ... @@ -127,9 +127,9 @@ pt:
127 127 metric_configuration_name: "Nome da Métrica:"
128 128 metric_configurations_description: "Descrição da métrica:"
129 129 metric_configurations_base_tool_name: "Nome da ferramenta base:"
130   - metric_configurations_aggregation: "Forma de Agregação:"
131   - metric_configurations_reading_group: "Nome do grupo:"
132   - created_metrics: "Criando Métricas"
  130 + metric_configurations_aggregation: "Forma de Agregação"
  131 + metric_configurations_reading_group: "Nome do grupo"
  132 + created_metrics: "Métricas Criadas"
133 133 resend_instruction: "Reenviar instruções de confirmação"
134 134 confirm_account_email: "Você pode confirmar a sua conta de e-mail através do link abaixo:"
135 135 request_change_password: "Alguém pediu um link para alterar sua senha. Você pode fazer isso através do link abaixo:"
... ... @@ -153,11 +153,12 @@ pt:
153 153 stay_logged: "Fique conectado."
154 154 resend_unclok_instructions: "Reenviar instruções para desbloquear"
155 155 grade: "Nota"
  156 + grades_belonging_to_a_module: "através de suas Notas"
156 157 edit_configuration: "Editar configurações"
157 158 must_logged_configuration: "Você precisa estar logado para criar novas configurações."
158 159 new_configuration: "Nova Configuração"
159   - calculate_weighted_average: "Ele é usado para calcular a média ponderada de um"
160   - measured_metric: "medido por essa métrica."
  160 + calculate_weighted_average: "Ele é usado para calcular a média ponderada de um "
  161 + measured_metric: "medidos por essa métrica."
161 162 change_password: "Mude sua senha"
162 163 no_metric_configurations: "Não há configurações de métricas ainda!"
163 164 range_lower_limit: "Limite de intervalo inferior."
... ... @@ -175,8 +176,8 @@ pt:
175 176 edit_reading_group: "Edite Grupos de Leitura"
176 177 must_logged_create_reading_groups: "Você precisa estar logado para criar novos grupos de leitura."
177 178 new_reading_group: "Novo Grupo de Leitura"
178   - destroy_metric_configuration: "Destrói Configuração de Métrica"
179   - sure_destroy_metric_configuration: "Tem certeza que você quer destruir esta configuração de métrica?"
  179 + destroy_metric_configuration: "Destruir Configuração de Métrica"
  180 + sure_destroy_metric_configuration: "Tem certeza que você quer destruir esta Configuração de Métrica?"
180 181 confirm_my_account: "Confirme sua conta"
181 182 change_my_password: "Alterar a senha"
182 183 unlock_my_account: "Desbloquear a minha conta"
... ...