From 7ca0abeaac0eeb6da108f04e9100e085a63d855c Mon Sep 17 00:00:00 2001 From: Rafael Reggiani Manzo Date: Fri, 20 Mar 2015 19:19:30 -0300 Subject: [PATCH] Translations for Repository --- app/views/modules/_metric_results.html.erb | 8 ++++---- app/views/modules/_module_tree.html.erb | 12 ++++++------ app/views/repositories/_form.html.erb | 16 ++++++++-------- app/views/repositories/_metric_results_error.html.erb | 2 +- app/views/repositories/_module_tree_error.html.erb | 2 +- app/views/repositories/_processing_information.html.erb | 4 ++-- app/views/repositories/_unstarted_processing.html.erb | 4 ++-- app/views/repositories/edit.html.erb | 2 +- app/views/repositories/new.html.erb | 2 +- app/views/repositories/show.html.erb | 34 +++++++++++++++++----------------- config/locales/modules/en.yml | 19 +++++++++++++++++++ config/locales/modules/pt.yml | 19 +++++++++++++++++++ config/locales/views/processing/en.yml | 10 ++++++++++ config/locales/views/processing/pt.yml | 22 ++++++++++++++++++++++ config/locales/views/repository/en.yml | 36 ++++++++++++++++++++++++++++++++++++ config/locales/views/repository/pt.yml | 36 ++++++++++++++++++++++++++++++++++++ features/repository/show/date_select.feature | 8 ++++---- features/repository/show/repository_info.feature | 6 +++--- features/step_definitions/repository_steps.rb | 10 +++++++--- 19 files changed, 199 insertions(+), 53 deletions(-) create mode 100644 config/locales/modules/en.yml create mode 100644 config/locales/modules/pt.yml create mode 100644 config/locales/views/processing/en.yml create mode 100644 config/locales/views/processing/pt.yml create mode 100644 config/locales/views/repository/en.yml create mode 100644 config/locales/views/repository/pt.yml diff --git a/app/views/modules/_metric_results.html.erb b/app/views/modules/_metric_results.html.erb index f348c0c..f4935c8 100644 --- a/app/views/modules/_metric_results.html.erb +++ b/app/views/modules/_metric_results.html.erb @@ -1,9 +1,9 @@ - - - - + + + + diff --git a/app/views/modules/_module_tree.html.erb b/app/views/modules/_module_tree.html.erb index 75450dc..8392693 100644 --- a/app/views/modules/_module_tree.html.erb +++ b/app/views/modules/_module_tree.html.erb @@ -1,13 +1,13 @@

- Name: + <%= KalibroModule.human_attribute_name('name') %>: <%= format_module_name(@root_module_result.kalibro_module.name) %>

- Granularity: + <%= KalibroModule.human_attribute_name('granularity') %>: <%= @root_module_result.kalibro_module.granularity %>

- Grade: + <%= KalibroModule.human_attribute_name('grade') %>: <%= format_grade(@root_module_result.grade) %>

<% unless @root_module_result.parent_id.nil? %> @@ -19,9 +19,9 @@ <% unless children.empty? %>
MetricValueWeightThreshold<%= t('activemodel.attributes.metric_result.metric') %><%= t('activemodel.attributes.metric_result.value') %><%= t('activemodel.attributes.metric_result.weight') %><%= t('activemodel.attributes.metric_result.threshold') %>
- - - + + + <%= render partial: 'module_result', collection: children %> diff --git a/app/views/repositories/_form.html.erb b/app/views/repositories/_form.html.erb index b0572d9..b9830d4 100644 --- a/app/views/repositories/_form.html.erb +++ b/app/views/repositories/_form.html.erb @@ -11,7 +11,7 @@

- The name of your Repository. + <%= t('activemodel.hints.repository.name') %>

@@ -23,7 +23,7 @@

- A short description of your Repository. + <%= t('activemodel.hints.repository.description') %>

@@ -35,7 +35,7 @@

- The source code's license. + <%= t('activemodel.hints.repository.license') %>

@@ -47,7 +47,7 @@

- The version control system the Repository uses. + <%= t('activemodel.hints.repository.scm_type') %>

@@ -59,7 +59,7 @@

- The URL where the Repository is located. + <%= t('activemodel.hints.repository.address') %>

@@ -71,20 +71,20 @@

- Select how often the Repository will be reprocessed. + <%= t('activemodel.hints.repository.period') %>

- <%= f.label :kalibro_configuration_id, 'Configuration', class: 'control-label' %> + <%= f.label :kalibro_configuration_id, KalibroConfiguration.model_name.human, class: 'control-label' %> <% configuration_list = KalibroClient::Entities::Configurations::KalibroConfiguration.all.map { |conf| [conf.name, conf.id] } %> <%= f.select( :kalibro_configuration_id, configuration_list, class: 'tooltip-control' ) %>

- A <%= link_to 'Configuration', tutorials_path('keywords', anchor: 'configuration') %> defines all the metrics to be calculated in the source code. Choose your weapon! + <%= t('activemodel.hints.repository.kalibro_configuration', configuration_href: link_to(KalibroConfiguration.model_name.human, tutorials_path('keywords', anchor: 'configuration'))).html_safe %>

diff --git a/app/views/repositories/_metric_results_error.html.erb b/app/views/repositories/_metric_results_error.html.erb index 2dd83de..6cd61f3 100644 --- a/app/views/repositories/_metric_results_error.html.erb +++ b/app/views/repositories/_metric_results_error.html.erb @@ -1 +1 @@ -

Repository process returned with error. There are no metric results.

\ No newline at end of file +

<%= t('activemodel.errors.repository.no_metric_results') %>

\ No newline at end of file diff --git a/app/views/repositories/_module_tree_error.html.erb b/app/views/repositories/_module_tree_error.html.erb index 1ce8927..f714917 100644 --- a/app/views/repositories/_module_tree_error.html.erb +++ b/app/views/repositories/_module_tree_error.html.erb @@ -1 +1 @@ -

Repository process returned with error. There is no module tree.

\ No newline at end of file +

<%= t('activemodel.errors.repository.no_module_tree') %>

\ No newline at end of file diff --git a/app/views/repositories/_processing_information.html.erb b/app/views/repositories/_processing_information.html.erb index 908879e..7a6e44d 100644 --- a/app/views/repositories/_processing_information.html.erb +++ b/app/views/repositories/_processing_information.html.erb @@ -1,10 +1,10 @@

- State: + <%= t('activemodel.attributes.processing.state') %>: <%= @processing.state %>

- Creation date: + <%= t('activemodel.attributes.processing.creation_date') %>: <%= @processing.created_at.strftime("%Y/%m/%d at %Hh%M (%z)") %>

diff --git a/app/views/repositories/_unstarted_processing.html.erb b/app/views/repositories/_unstarted_processing.html.erb index 53fd470..2a55ff3 100644 --- a/app/views/repositories/_unstarted_processing.html.erb +++ b/app/views/repositories/_unstarted_processing.html.erb @@ -1,3 +1,3 @@ -

This Repository has no processings yet. Please, wait an instant as we start it.

+

<%= t('activemodel.errors.repository.unstarted_processing') %>

-
<%= image_tag 'loader.gif' %> Loading data. Please, wait.
\ No newline at end of file +
<%= image_tag 'loader.gif' %> <%= t('repository.show.loading') %>
\ No newline at end of file diff --git a/app/views/repositories/edit.html.erb b/app/views/repositories/edit.html.erb index e1af945..42c8890 100644 --- a/app/views/repositories/edit.html.erb +++ b/app/views/repositories/edit.html.erb @@ -1,5 +1,5 @@ <%= form_for(@repository, :url => project_repository_update_url(@project_id, @repository.id), method: :put) do |f| %> diff --git a/app/views/repositories/new.html.erb b/app/views/repositories/new.html.erb index 7c35b39..3078544 100644 --- a/app/views/repositories/new.html.erb +++ b/app/views/repositories/new.html.erb @@ -1,5 +1,5 @@ <%= form_for(@repository, :url => project_repositories_url(@project_id)) do |f| %> diff --git a/app/views/repositories/show.html.erb b/app/views/repositories/show.html.erb index 624edff..dfc3613 100644 --- a/app/views/repositories/show.html.erb +++ b/app/views/repositories/show.html.erb @@ -3,36 +3,36 @@

- Description: + <%= Repository.human_attribute_name('description') %>: <%= @repository.description %>

- License: + <%= Repository.human_attribute_name('license') %>: <%= @repository.license %>

- Type: + <%= Repository.human_attribute_name('type') %>: <%= @repository.scm_type %>

- Address: + <%= Repository.human_attribute_name('address') %>: <%= @repository.address %>

- Periodicity: + <%= Repository.human_attribute_name('period') %>: <%= periodicity_option(@repository.period) %>

- Configuration: + <%= KalibroConfiguration.model_name.human %>: <%= @kalibro_configuration.name %>

-

Retrieve the closest processing information from:

+

<%= t('repository.show.date_processing') %>:

<%= form_tag(project_repository_state_with_date_path(@repository.project_id, @repository.id), method: "post", remote: true) do %>

@@ -42,7 +42,7 @@ <%= select_tag(:month, options_for_select(month_options), :style => "width:55px; margin-top:5px") %> <%= label_tag :year, t("year") %>: <%= select_tag(:year, options_for_select(year_options), :style => "width:70px; margin-top:5px") %> - <%= submit_tag("Search", class: 'btn btn-info', style: 'margin-bottom:5px', onClick: "Module.Repository.set_loader('#{image_tag 'loader.gif'} Loading data. Please, wait.')") %> + <%= submit_tag(t('search'), class: 'btn btn-info', style: 'margin-bottom:5px', onClick: "Module.Repository.set_loader('#{image_tag 'loader.gif'} Loading data. Please, wait.')") %>

<% end %> @@ -50,18 +50,18 @@
-

Processing information

-
<%= image_tag 'loader.gif' %> Loading data. Please, wait.
+

<%= t('repository.show.processing_information') %>

+
<%= image_tag 'loader.gif' %> <%= t('repository.show.loading') %>
-

Modules Tree

-
<%= image_tag 'loader.gif' %> Loading data. Please, wait.
+

<%= t('repository.show.modules_tree') %>

+
<%= image_tag 'loader.gif' %> <%= t('repository.show.loading') %>
-

Metric Results

-
<%= image_tag 'loader.gif' %> Loading data. Please, wait.
+

<%= t('repository.show.metric_results') %>

+
<%= image_tag 'loader.gif' %> <%= t('repository.show.loading') %>
NameGranularityGrade<%= KalibroModule.human_attribute_name('name') %><%= KalibroModule.human_attribute_name('granularity') %><%= KalibroModule.human_attribute_name('grade') %>