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 | 1 | module CompoundMetricConfigurationsHelper |
2 | 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 | 4 | end |
5 | 5 | end | ... | ... |
app/helpers/kalibro_configurations_helper.rb
... | ... | @@ -5,17 +5,17 @@ module KalibroConfigurationsHelper |
5 | 5 | |
6 | 6 | def link_to_edit_form(metric_configuration, kalibro_configuration_id) |
7 | 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 | 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 | 11 | end |
12 | 12 | end |
13 | 13 | |
14 | 14 | def link_to_show_page(metric_configuration, kalibro_configuration_id) |
15 | 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 | 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 | 19 | end |
20 | 20 | end |
21 | 21 | end | ... | ... |
app/helpers/metric_configurations_helper.rb
1 | 1 | module MetricConfigurationsHelper |
2 | 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 | 4 | end |
6 | 5 | |
7 | 6 | def reading_group_options | ... | ... |
app/views/metric_configurations/_form.html.erb
... | ... | @@ -10,19 +10,19 @@ |
10 | 10 | </div> |
11 | 11 | <div class="help-container"> |
12 | 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 | 14 | </p> |
15 | 15 | </div> |
16 | 16 | </div> |
17 | 17 | |
18 | 18 | <div class="form-row"> |
19 | 19 | <div class="field-container"> |
20 | - <%= f.label :aggregation_form, 'Aggregation Form', class: 'control-label' %> | |
20 | + <%= f.label :aggregation_form, class: 'control-label' %> | |
21 | 21 | <%= f.select( :aggregation_form, aggregation_options, {class: 'form-control'} ) %> |
22 | 22 | </div> |
23 | 23 | <div class="help-container"> |
24 | 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 | 26 | </p> |
27 | 27 | </div> |
28 | 28 | </div> |
... | ... | @@ -33,12 +33,12 @@ |
33 | 33 | <% else %> |
34 | 34 | <div class="form-row"> |
35 | 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 | 37 | <%= f.select( :reading_group_id, reading_group_options, {class: 'form-control'} ) %> |
38 | 38 | </div> |
39 | 39 | <div class="help-container"> |
40 | 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 | 42 | </p> |
43 | 43 | </div> |
44 | 44 | </div> | ... | ... |
app/views/metric_configurations/_no_ranges.html.erb
1 | 1 | <tr> |
2 | 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 | 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 | 9 | <td><%= kalibro_range.end %></td> |
10 | 10 | <td> |
11 | 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 | 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 | 16 | class: 'btn btn-danger' %> |
17 | 17 | <% end %> |
18 | 18 | </td> | ... | ... |
app/views/metric_configurations/choose_metric.html.erb
1 | 1 | <div class="page-header"> |
2 | - <h1>Choose a metric from a Base Tool:</h1> | |
2 | + <h1><%= t('choose_metric') %></h1> | |
3 | 3 | </div> |
4 | 4 | |
5 | 5 | <%= form_tag kalibro_configuration_new_metric_configuration_path(@kalibro_configuration.id) do %> |
... | ... | @@ -18,8 +18,8 @@ |
18 | 18 | <% end %> |
19 | 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 | 25 | <script type="text/javascript"> | ... | ... |
... | ... | @@ -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 @@ |
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 | 22 | en: |
23 | 23 | #commons |
24 | 24 | show: "Show" |
25 | - edit: "Edit %{model}" | |
25 | + edit_model: "Edit %{model}" | |
26 | + edit: "Edit" | |
26 | 27 | edit_user: "Edit User" |
27 | 28 | end: "End" |
28 | 29 | the: "The" |
... | ... | @@ -129,7 +130,6 @@ en: |
129 | 130 | new_configuration: "New Configuration" |
130 | 131 | measured_metric_html: "The %{href} of the %{href2} measured by this metric." |
131 | 132 | change_password: "Change your password " |
132 | - calculate_weighted_average: "It is used to calculate the weighted average of the " | |
133 | 133 | range_lower_limit: "This Range's lower limit." |
134 | 134 | range_upper_limit: "This Range's upper limit." |
135 | 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 | 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 | 2 | weighted_average_metric_configurations_form: "It is used to calculate the weighted average of a" |
12 | 3 | statistical_result_metric_configurations_form: "It is the calculation of statistical results for higher" |
13 | 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 | 20 | metric_scope: "Scope" |
30 | 21 | metric_aggregation_form: "Aggregation Form" |
31 | 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 | 28 | scopes: |
33 | 29 | METHOD: "Method" |
34 | 30 | CLASS: "Class" | ... | ... |
config/locales/views/metric_configurations/pt.yml
... | ... | @@ -8,6 +8,8 @@ pt: |
8 | 8 | metric_configuration: |
9 | 9 | metric: Métrica |
10 | 10 | weight: Peso |
11 | + aggregation_form: Forma de Agregação | |
12 | + reading_group_id: Grupo de Leitura | |
11 | 13 | weighted_average_metric_configurations_form: "Ele é usado para calcular a média ponderada de um" |
12 | 14 | statistical_result_metric_configurations_form: "É o cálculo dos resultados estatísticos para maior" |
13 | 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 | 31 | metric_scope: "Escopo" |
30 | 32 | metric_aggregation_form: "Forma de Agregação" |
31 | 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 | 39 | scopes: |
33 | 40 | METHOD: "Método" |
34 | 41 | CLASS: "Classe" | ... | ... |
config/locales/views/pt.yml
... | ... | @@ -22,7 +22,8 @@ |
22 | 22 | pt: |
23 | 23 | #commons |
24 | 24 | show: "Mostrar" |
25 | - edit: "Editar %{model}" | |
25 | + edit_model: "Editar %{model}" | |
26 | + edit: "Editar" | |
26 | 27 | edit_user: "Editar Usuário" |
27 | 28 | end: "Fim" |
28 | 29 | the: "A" |
... | ... | @@ -126,7 +127,6 @@ pt: |
126 | 127 | edit_configuration: "Editar configurações" |
127 | 128 | must_logged_configuration: "Você precisa estar logado para criar novas configurações." |
128 | 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 | 130 | measured_metric_html: "A %{href} dos %{href2} medidos por esta métrica." |
131 | 131 | change_password: "Mude sua senha" |
132 | 132 | range_lower_limit: "Limite de intervalo inferior." |
... | ... | @@ -156,7 +156,7 @@ pt: |
156 | 156 | received_unlock_instructions: "Você recebeu instruções de desbloqueio?" |
157 | 157 | your_projects: "Seus projetos" |
158 | 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 | 160 | add_metric: "Adicionando Métrica" |
161 | 161 | destroy_configuration: "Destruindo Configuração" |
162 | 162 | want_destroy_configuration: "Tem certeza que você quer destruir esta configuração?" | ... | ... |