Commit 87463bff228e567cd2857b3e260559eab5af17f0
Committed by
Rafael Manzo
1 parent
14d81fa6
Exists in
colab
and in
4 other branches
Finished metric configuration internationalization
Signed-off-by: Pedro Scocco <pedroscocco@gmail.com>
Showing
13 changed files
with
78 additions
and
34 deletions
Show diff stats
app/helpers/compound_metric_configurations_helper.rb
1 | module CompoundMetricConfigurationsHelper | 1 | module CompoundMetricConfigurationsHelper |
2 | def scope_options | 2 | def scope_options |
3 | - [["Method","METHOD"], ["Class", "CLASS"], ["Package", "PACKAGE"], ["Software", "SOFTWARE"]] | 3 | + [[t("scopes.METHOD"),"METHOD"], [t("scopes.CLASS"), "CLASS"], [t("scopes.PACKAGE"), "PACKAGE"], [t("scopes.SOFTWARE"), "SOFTWARE"]] |
4 | end | 4 | end |
5 | end | 5 | end |
app/helpers/kalibro_configurations_helper.rb
@@ -5,17 +5,17 @@ module KalibroConfigurationsHelper | @@ -5,17 +5,17 @@ module KalibroConfigurationsHelper | ||
5 | 5 | ||
6 | def link_to_edit_form(metric_configuration, kalibro_configuration_id) | 6 | def link_to_edit_form(metric_configuration, kalibro_configuration_id) |
7 | if (metric_configuration.metric.is_a? KalibroClient::Entities::Miscellaneous::CompoundMetric) | 7 | if (metric_configuration.metric.is_a? KalibroClient::Entities::Miscellaneous::CompoundMetric) |
8 | - link_to('Edit', edit_kalibro_configuration_compound_metric_configuration_path(kalibro_configuration_id, metric_configuration.id), class: 'btn btn-info') | 8 | + link_to(t('edit'), edit_kalibro_configuration_compound_metric_configuration_path(kalibro_configuration_id, metric_configuration.id), class: 'btn btn-info') |
9 | else | 9 | else |
10 | - link_to('Edit', edit_kalibro_configuration_metric_configuration_path(kalibro_configuration_id, metric_configuration.id), class: 'btn btn-info') | 10 | + link_to(t('edit'), edit_kalibro_configuration_metric_configuration_path(kalibro_configuration_id, metric_configuration.id), class: 'btn btn-info') |
11 | end | 11 | end |
12 | end | 12 | end |
13 | 13 | ||
14 | def link_to_show_page(metric_configuration, kalibro_configuration_id) | 14 | def link_to_show_page(metric_configuration, kalibro_configuration_id) |
15 | if (metric_configuration.metric.is_a? KalibroClient::Entities::Miscellaneous::CompoundMetric) | 15 | if (metric_configuration.metric.is_a? KalibroClient::Entities::Miscellaneous::CompoundMetric) |
16 | - link_to('Show', kalibro_configuration_compound_metric_configuration_path(kalibro_configuration_id, metric_configuration.id), class: 'btn btn-info') | 16 | + link_to(t('show'), kalibro_configuration_compound_metric_configuration_path(kalibro_configuration_id, metric_configuration.id), class: 'btn btn-info') |
17 | else | 17 | else |
18 | - link_to('Show', kalibro_configuration_metric_configuration_path(kalibro_configuration_id, metric_configuration.id), class: 'btn btn-info') | 18 | + link_to(t('show'), kalibro_configuration_metric_configuration_path(kalibro_configuration_id, metric_configuration.id), class: 'btn btn-info') |
19 | end | 19 | end |
20 | end | 20 | end |
21 | end | 21 | end |
app/helpers/metric_configurations_helper.rb
1 | module MetricConfigurationsHelper | 1 | module MetricConfigurationsHelper |
2 | def aggregation_options | 2 | def aggregation_options |
3 | - [["Average","AVERAGE"], ["Median", "MEDIAN"], ["Maximum", "MAXIMUM"], ["Minimum", "MINIMUM"], | ||
4 | - ["Standard Deviation", "STANDARD_DEVIATION"], ["Count", "COUNT"]] | 3 | + [[t("aggregation_forms.AVERAGE"),"AVERAGE"], [t("aggregation_forms.MEDIAN"), "MEDIAN"], [t("aggregation_forms.MAXIMUM"), "MAXIMUM"], [t("aggregation_forms.MINIMUM"), "MINIMUM"], [t("aggregation_forms.STANDARD_DEVIATION"), "STANDARD_DEVIATION"], ["Count", "COUNT"]] |
5 | end | 4 | end |
6 | 5 | ||
7 | def reading_group_options | 6 | def reading_group_options |
app/views/metric_configurations/_form.html.erb
@@ -10,19 +10,19 @@ | @@ -10,19 +10,19 @@ | ||
10 | </div> | 10 | </div> |
11 | <div class="help-container"> | 11 | <div class="help-container"> |
12 | <p> | 12 | <p> |
13 | - It is used to calculate the weighted average of a <%= link_to 'module', tutorials_path("keywords", anchor: "module")%>'s grade. | 13 | + <%= t('calculate_weighted_average_html', href: link_to(KalibroModule.model_name.human, tutorials_path("keywords", anchor: "module"))) %> |
14 | </p> | 14 | </p> |
15 | </div> | 15 | </div> |
16 | </div> | 16 | </div> |
17 | 17 | ||
18 | <div class="form-row"> | 18 | <div class="form-row"> |
19 | <div class="field-container"> | 19 | <div class="field-container"> |
20 | - <%= f.label :aggregation_form, 'Aggregation Form', class: 'control-label' %> | 20 | + <%= f.label :aggregation_form, class: 'control-label' %> |
21 | <%= f.select( :aggregation_form, aggregation_options, {class: 'form-control'} ) %> | 21 | <%= f.select( :aggregation_form, aggregation_options, {class: 'form-control'} ) %> |
22 | </div> | 22 | </div> |
23 | <div class="help-container"> | 23 | <div class="help-container"> |
24 | <p> | 24 | <p> |
25 | - It is the calculation of statistical results for higher <%= link_to 'granularity', tutorials_path('keywords', anchor: 'granularity') %> modules (e.g., average lines of code of the classes inside a package). | 25 | + <%= t('aggregation_form_helper_html', href: link_to(t('granularity'), tutorials_path('keywords', anchor: 'granularity'))) %> |
26 | </p> | 26 | </p> |
27 | </div> | 27 | </div> |
28 | </div> | 28 | </div> |
@@ -33,12 +33,12 @@ | @@ -33,12 +33,12 @@ | ||
33 | <% else %> | 33 | <% else %> |
34 | <div class="form-row"> | 34 | <div class="form-row"> |
35 | <div class="field-container"> | 35 | <div class="field-container"> |
36 | - <%= f.label :reading_group_id, 'Reading Group', class: 'control-label' %> | 36 | + <%= f.label :reading_group_id, class: 'control-label' %> |
37 | <%= f.select( :reading_group_id, reading_group_options, {class: 'form-control'} ) %> | 37 | <%= f.select( :reading_group_id, reading_group_options, {class: 'form-control'} ) %> |
38 | </div> | 38 | </div> |
39 | <div class="help-container"> | 39 | <div class="help-container"> |
40 | <p> | 40 | <p> |
41 | - The <%= link_to 'Reading Group', tutorials_path('keywords', anchor: 'reading-group') %> associated with this metric. | 41 | + <%= t('reading_group_helper_html', href: link_to(ReadingGroup.model_name.human, tutorials_path('keywords', anchor: 'reading-group'))) %> |
42 | </p> | 42 | </p> |
43 | </div> | 43 | </div> |
44 | </div> | 44 | </div> |
app/views/metric_configurations/_no_ranges.html.erb
1 | <tr> | 1 | <tr> |
2 | <!-- TODO: expand this columns when the user owns the metric configurations and can edit or delete this range --> | 2 | <!-- TODO: expand this columns when the user owns the metric configurations and can edit or delete this range --> |
3 | - <td colspan="3">There are no Ranges yet!</td> | ||
4 | -</tr> | ||
5 | \ No newline at end of file | 3 | \ No newline at end of file |
4 | +<td colspan="3"><%= t('no_models', model: KalibroRange.model_name.human(count: 2)) %></td> | ||
5 | +</tr> |
app/views/metric_configurations/_ranges.html.erb
@@ -9,10 +9,10 @@ | @@ -9,10 +9,10 @@ | ||
9 | <td><%= kalibro_range.end %></td> | 9 | <td><%= kalibro_range.end %></td> |
10 | <td> | 10 | <td> |
11 | <% if kalibro_configuration_owner? @metric_configuration.kalibro_configuration_id %> | 11 | <% if kalibro_configuration_owner? @metric_configuration.kalibro_configuration_id %> |
12 | - <%= link_to 'Edit', edit_kalibro_configuration_metric_configuration_kalibro_range_path( | 12 | + <%= link_to t('edit'), edit_kalibro_configuration_metric_configuration_kalibro_range_path( |
13 | @metric_configuration.kalibro_configuration_id, @metric_configuration.id, kalibro_range.id), class: 'btn btn-info' %> | 13 | @metric_configuration.kalibro_configuration_id, @metric_configuration.id, kalibro_range.id), class: 'btn btn-info' %> |
14 | - <%= link_to 'Destroy', kalibro_configuration_metric_configuration_kalibro_range_path(@metric_configuration.kalibro_configuration_id, | ||
15 | - @metric_configuration.id, kalibro_range.id), method: :delete, data: { confirm: 'Are you sure that you want to destroy this Range?' }, | 14 | + <%= link_to t('destroy'), kalibro_configuration_metric_configuration_kalibro_range_path(@metric_configuration.kalibro_configuration_id, |
15 | + @metric_configuration.id, kalibro_range.id), method: :delete, data: { confirm: t('want_destroy_range') }, | ||
16 | class: 'btn btn-danger' %> | 16 | class: 'btn btn-danger' %> |
17 | <% end %> | 17 | <% end %> |
18 | </td> | 18 | </td> |
app/views/metric_configurations/choose_metric.html.erb
1 | <div class="page-header"> | 1 | <div class="page-header"> |
2 | - <h1>Choose a metric from a Base Tool:</h1> | 2 | + <h1><%= t('choose_metric') %></h1> |
3 | </div> | 3 | </div> |
4 | 4 | ||
5 | <%= form_tag kalibro_configuration_new_metric_configuration_path(@kalibro_configuration.id) do %> | 5 | <%= form_tag kalibro_configuration_new_metric_configuration_path(@kalibro_configuration.id) do %> |
@@ -18,8 +18,8 @@ | @@ -18,8 +18,8 @@ | ||
18 | <% end %> | 18 | <% end %> |
19 | </div><br /> | 19 | </div><br /> |
20 | 20 | ||
21 | -<%= link_to 'Back', kalibro_configuration_path(@kalibro_configuration.id), class: 'btn btn-default' %> | ||
22 | -<%= link_to 'Compound Metric', new_kalibro_configuration_compound_metric_configuration_path(@kalibro_configuration.id), class: 'btn btn-info', id: "link_to_compound" %> | 21 | +<%= link_to t('back'), kalibro_configuration_path(@kalibro_configuration.id), class: 'btn btn-default' %> |
22 | +<%= link_to t('compound_metric'), new_kalibro_configuration_compound_metric_configuration_path(@kalibro_configuration.id), class: 'btn btn-info', id: "link_to_compound" %> | ||
23 | 23 | ||
24 | 24 | ||
25 | <script type="text/javascript"> | 25 | <script type="text/javascript"> |
@@ -0,0 +1,21 @@ | @@ -0,0 +1,21 @@ | ||
1 | +en: | ||
2 | + activemodel: | ||
3 | + models: | ||
4 | + kalibro_module: | ||
5 | + one: "Module" | ||
6 | + other: "Modules" | ||
7 | + reading_group: | ||
8 | + one: "Reading Group" | ||
9 | + other: "Reading Groups" | ||
10 | + kalibro_range: | ||
11 | + one: "Range" | ||
12 | + other: "Ranges" | ||
13 | + metric_configuration: | ||
14 | + one: "Metric Configuration" | ||
15 | + other: "Metric Configurations" | ||
16 | + attributes: | ||
17 | + metric_configuration: | ||
18 | + metric: "Metric" | ||
19 | + weight: "Weight" | ||
20 | + aggregation_form: "Aggregation Form" | ||
21 | + reading_group_id: "Reading Group" |
@@ -0,0 +1,21 @@ | @@ -0,0 +1,21 @@ | ||
1 | +pt: | ||
2 | + activemodel: | ||
3 | + models: | ||
4 | + kalibro_module: | ||
5 | + one: "Módulo" | ||
6 | + other: "Módulos" | ||
7 | + reading_group: | ||
8 | + one: "Grupo de Leitura" | ||
9 | + other: "Grupos de Leitura" | ||
10 | + kalibro_range: | ||
11 | + one: "Intervalo" | ||
12 | + other: "Intervalos" | ||
13 | + metric_configuration: | ||
14 | + one: "Configuração de Métrica" | ||
15 | + other: "Configurações de Métricas" | ||
16 | + attributes: | ||
17 | + metric_configuration: | ||
18 | + metric: "Métrica" | ||
19 | + weight: "Peso" | ||
20 | + aggregation_form: "Forma de Agregação" | ||
21 | + reading_group_id: "Grupo de Leitura" |
config/locales/views/en.yml
@@ -22,7 +22,8 @@ | @@ -22,7 +22,8 @@ | ||
22 | en: | 22 | en: |
23 | #commons | 23 | #commons |
24 | show: "Show" | 24 | show: "Show" |
25 | - edit: "Edit %{model}" | 25 | + edit_model: "Edit %{model}" |
26 | + edit: "Edit" | ||
26 | edit_user: "Edit User" | 27 | edit_user: "Edit User" |
27 | end: "End" | 28 | end: "End" |
28 | the: "The" | 29 | the: "The" |
@@ -129,7 +130,6 @@ en: | @@ -129,7 +130,6 @@ en: | ||
129 | new_configuration: "New Configuration" | 130 | new_configuration: "New Configuration" |
130 | measured_metric_html: "The %{href} of the %{href2} measured by this metric." | 131 | measured_metric_html: "The %{href} of the %{href2} measured by this metric." |
131 | change_password: "Change your password " | 132 | change_password: "Change your password " |
132 | - calculate_weighted_average: "It is used to calculate the weighted average of the " | ||
133 | range_lower_limit: "This Range's lower limit." | 133 | range_lower_limit: "This Range's lower limit." |
134 | range_upper_limit: "This Range's upper limit." | 134 | range_upper_limit: "This Range's upper limit." |
135 | explanation_chose_interval: "An explanation of why you chose this interval, with that reading for this" | 135 | explanation_chose_interval: "An explanation of why you chose this interval, with that reading for this" |
config/locales/views/metric_configurations/en.yml
1 | en: | 1 | en: |
2 | - activemodel: | ||
3 | - models: | ||
4 | - metric_configuration: | ||
5 | - one: Metric Configuration | ||
6 | - other: Metric Configurations | ||
7 | - attributes: | ||
8 | - metric_configuration: | ||
9 | - metric: 'Metric' | ||
10 | - weight: 'Weight' | ||
11 | weighted_average_metric_configurations_form: "It is used to calculate the weighted average of a" | 2 | weighted_average_metric_configurations_form: "It is used to calculate the weighted average of a" |
12 | statistical_result_metric_configurations_form: "It is the calculation of statistical results for higher" | 3 | statistical_result_metric_configurations_form: "It is the calculation of statistical results for higher" |
13 | modules_eg_metric_configurations_form: " modules (e.g., average lines of code of the classes inside a package)." | 4 | modules_eg_metric_configurations_form: " modules (e.g., average lines of code of the classes inside a package)." |
@@ -29,6 +20,11 @@ en: | @@ -29,6 +20,11 @@ en: | ||
29 | metric_scope: "Scope" | 20 | metric_scope: "Scope" |
30 | metric_aggregation_form: "Aggregation Form" | 21 | metric_aggregation_form: "Aggregation Form" |
31 | reading_group_name: "Reading Group Name" | 22 | reading_group_name: "Reading Group Name" |
23 | + calculate_weighted_average_html: "It is used to calculate the weighted average of a %{href}'s grade" | ||
24 | + aggregation_form_helper_html: "It is the calculation of statistical results for higher %{href} modules (e.g., average lines of code of the classes inside a package)." | ||
25 | + reading_group_helper_html: "The %{href} associated with this metric." | ||
26 | + no_models: "There are no %{model} yet!" | ||
27 | + choose_metric: "Choose a metric from a Base Tool:" | ||
32 | scopes: | 28 | scopes: |
33 | METHOD: "Method" | 29 | METHOD: "Method" |
34 | CLASS: "Class" | 30 | CLASS: "Class" |
config/locales/views/metric_configurations/pt.yml
@@ -8,6 +8,8 @@ pt: | @@ -8,6 +8,8 @@ pt: | ||
8 | metric_configuration: | 8 | metric_configuration: |
9 | metric: Métrica | 9 | metric: Métrica |
10 | weight: Peso | 10 | weight: Peso |
11 | + aggregation_form: Forma de Agregação | ||
12 | + reading_group_id: Grupo de Leitura | ||
11 | weighted_average_metric_configurations_form: "Ele é usado para calcular a média ponderada de um" | 13 | weighted_average_metric_configurations_form: "Ele é usado para calcular a média ponderada de um" |
12 | statistical_result_metric_configurations_form: "É o cálculo dos resultados estatísticos para maior" | 14 | statistical_result_metric_configurations_form: "É o cálculo dos resultados estatísticos para maior" |
13 | modules_eg_metric_configurations_form: "módulos (por exemplo, as linhas médias de código das classes dentro de um pacote)." | 15 | modules_eg_metric_configurations_form: "módulos (por exemplo, as linhas médias de código das classes dentro de um pacote)." |
@@ -29,6 +31,11 @@ pt: | @@ -29,6 +31,11 @@ pt: | ||
29 | metric_scope: "Escopo" | 31 | metric_scope: "Escopo" |
30 | metric_aggregation_form: "Forma de Agregação" | 32 | metric_aggregation_form: "Forma de Agregação" |
31 | reading_group_name: "Nome do Grupo de Leitura" | 33 | reading_group_name: "Nome do Grupo de Leitura" |
34 | + calculate_weighted_average_html: "É usado para calcular a média ponderada das notas de um %{href}" | ||
35 | + aggregation_form_helper_html: "É o cálculo dos resultados estatísticos para módulos de maior %{href} (por exemplo número médio de linhas das classes dentro de um pacote)" | ||
36 | + reading_group_helper_html: "O %{href} associado com esta métrica." | ||
37 | + no_models: "Não há %{model} ainda!" | ||
38 | + choose_metric: "Escolha uma métrica de um Coletor:" | ||
32 | scopes: | 39 | scopes: |
33 | METHOD: "Método" | 40 | METHOD: "Método" |
34 | CLASS: "Classe" | 41 | CLASS: "Classe" |
config/locales/views/pt.yml
@@ -22,7 +22,8 @@ | @@ -22,7 +22,8 @@ | ||
22 | pt: | 22 | pt: |
23 | #commons | 23 | #commons |
24 | show: "Mostrar" | 24 | show: "Mostrar" |
25 | - edit: "Editar %{model}" | 25 | + edit_model: "Editar %{model}" |
26 | + edit: "Editar" | ||
26 | edit_user: "Editar Usuário" | 27 | edit_user: "Editar Usuário" |
27 | end: "Fim" | 28 | end: "Fim" |
28 | the: "A" | 29 | the: "A" |
@@ -126,7 +127,6 @@ pt: | @@ -126,7 +127,6 @@ pt: | ||
126 | edit_configuration: "Editar configurações" | 127 | edit_configuration: "Editar configurações" |
127 | must_logged_configuration: "Você precisa estar logado para criar novas configurações." | 128 | must_logged_configuration: "Você precisa estar logado para criar novas configurações." |
128 | new_configuration: "Nova Configuração" | 129 | new_configuration: "Nova Configuração" |
129 | - calculate_weighted_average_html: "Ele é usado para calcular a média ponderada de um %{href} através de suas Notas" | ||
130 | measured_metric_html: "A %{href} dos %{href2} medidos por esta métrica." | 130 | measured_metric_html: "A %{href} dos %{href2} medidos por esta métrica." |
131 | change_password: "Mude sua senha" | 131 | change_password: "Mude sua senha" |
132 | range_lower_limit: "Limite de intervalo inferior." | 132 | range_lower_limit: "Limite de intervalo inferior." |
@@ -156,7 +156,7 @@ pt: | @@ -156,7 +156,7 @@ pt: | ||
156 | received_unlock_instructions: "Você recebeu instruções de desbloqueio?" | 156 | received_unlock_instructions: "Você recebeu instruções de desbloqueio?" |
157 | your_projects: "Seus projetos" | 157 | your_projects: "Seus projetos" |
158 | mezuro_team: "A Equipe Mezuro" | 158 | mezuro_team: "A Equipe Mezuro" |
159 | - want_destroy_range: "Tem certeza que você quer destruir este intervalo?" | 159 | + want_destroy_range: "Tem certeza que você quer destruir este Intervalo?" |
160 | add_metric: "Adicionando Métrica" | 160 | add_metric: "Adicionando Métrica" |
161 | destroy_configuration: "Destruindo Configuração" | 161 | destroy_configuration: "Destruindo Configuração" |
162 | want_destroy_configuration: "Tem certeza que você quer destruir esta configuração?" | 162 | want_destroy_configuration: "Tem certeza que você quer destruir esta configuração?" |