From: Fabrice Bellingard Date: Wed, 20 Jul 2011 16:29:43 +0000 (+0200) Subject: SONAR-2589 Modification of all web ruby templates to use bundles X-Git-Tag: 2.10~121 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=98f009fed3aaede468f70bb2d848e31e5e54b7d2;p=sonarqube.git SONAR-2589 Modification of all web ruby templates to use bundles - Fix small bug on filter columns - Add I18n on violation drilldown - Add I18n on violation timemachine --- diff --git a/plugins/sonar-i18n-en-plugin/src/main/resources/org/sonar/i18n/core.properties b/plugins/sonar-i18n-en-plugin/src/main/resources/org/sonar/i18n/core.properties index 5ec3792e73c..ce0be9f9466 100644 --- a/plugins/sonar-i18n-en-plugin/src/main/resources/org/sonar/i18n/core.properties +++ b/plugins/sonar-i18n-en-plugin/src/main/resources/org/sonar/i18n/core.properties @@ -18,10 +18,12 @@ bold=Bold build_date=Build date cancel=Cancel category=Category +calendar=Calendar change_verb=Change configure=Configure class=Class classes=Classes +clear_verb=Clear closed=Closed code=Code color=Color @@ -44,6 +46,7 @@ file=File files=Files filter_verb=Filter follow=Follow +hide=Hide identifier_abbreviated=Id info=Info key=Key @@ -455,6 +458,32 @@ components.explanation_launch_sonar_to_have_results=If Maven and Sonar are insta components.note_changes_impact_all_users=Note that these changes will impact all users and all projects. +#------------------------------------------------------------------------------ +# +# DRILLDOWN +# +#------------------------------------------------------------------------------ + +drilldown.click_for_more_on_x=Click for more on {0} : {1} +drilldown.no_violations=No violations +drilldown.any_severity=Any severity +drilldown.any_rule=Any rule + + +#------------------------------------------------------------------------------ +# +# TIME MACHINE +# +#------------------------------------------------------------------------------ + +time_machine.show_date=Show date +time_machine.show_event=Show event +time_machine.distributions=Distributions +time_machine.distribution_chart=Distribution chart +time_machine.compare_on_chart=Compare on chart +time_machine.set_as_default_for_all_users=Set as default (for all users) + + #------------------------------------------------------------------------------ # # REVIEWS diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/filter_column.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/filter_column.rb index 8b014ac9e57..fe9d8cd678a 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/models/filter_column.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/models/filter_column.rb @@ -39,7 +39,7 @@ class FilterColumn < ActiveRecord::Base def name if on_metric? - Java::OrgSonarServerUi::JRubyFacade.getInstance().getI18nMessage(I18n.locale, "metric." + kee + ".name", nil, [].to_java) + Java::OrgSonarServerUi::JRubyFacade.getInstance().getI18nMessage(I18n.locale, "metric." + kee + ".name", metric.short_name, [].to_java) else Java::OrgSonarServerUi::JRubyFacade.getInstance().getI18nMessage(I18n.locale, family, kee, [].to_java) end diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/rules_parameter.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/rules_parameter.rb index f5da840eb28..acd78c8ecf2 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/models/rules_parameter.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/models/rules_parameter.rb @@ -50,7 +50,7 @@ class RulesParameter < ActiveRecord::Base return nil if (rule_plugin_name.nil? or rule_plugin_rule_key.nil?) i18n_key = 'rule.' + rule_plugin_name + '.' + rule_plugin_rule_key + '.param.' + read_attribute(:name) - result = Java::OrgSonarServerUi::JRubyFacade.getInstance().getI18nMessage(I18n.locale, i18n_key, nil, [].to_java) + result = Java::OrgSonarServerUi::JRubyFacade.getInstance().getI18nMessage(I18n.locale, i18n_key, default_string, [].to_java) result end diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/drilldown/measures.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/drilldown/measures.html.erb index a3d3cb61ca4..b15463e7cee 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/drilldown/measures.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/drilldown/measures.html.erb @@ -8,7 +8,7 @@ - + <%= violation_period_select_options(@snapshot, 1) -%> <%= violation_period_select_options(@snapshot, 2) -%> <%= violation_period_select_options(@snapshot, 3) -%> @@ -49,17 +49,17 @@ max = value if value && value>max end %> -

Severity

+

<%= message('severity') -%>

- <%= render :partial => 'rule_priority', :locals => {:label => 'Blocker', :css => 'even', :priority_id => Sonar::RulePriority::PRIORITY_BLOCKER, :max => max, :measure => blocker_violations }%> - <%= render :partial => 'rule_priority', :locals => {:label => 'Critical', :css => 'odd', :priority_id => Sonar::RulePriority::PRIORITY_CRITICAL, :max => max, :measure => critical_violations }%> - <%= render :partial => 'rule_priority', :locals => {:label => 'Major', :css => 'even', :priority_id => Sonar::RulePriority::PRIORITY_MAJOR, :max => max, :measure => major_violations }%> - <%= render :partial => 'rule_priority', :locals => {:label => 'Minor', :css => 'odd', :priority_id => Sonar::RulePriority::PRIORITY_MINOR, :max => max, :measure => minor_violations }%> - <%= render :partial => 'rule_priority', :locals => {:label => 'Info', :css => 'even', :priority_id => Sonar::RulePriority::PRIORITY_INFO, :max => max, :measure => info_violations }%> + <%= render :partial => 'rule_priority', :locals => {:label => message('blocker'), :css => 'even', :priority_id => Sonar::RulePriority::PRIORITY_BLOCKER, :max => max, :measure => blocker_violations }%> + <%= render :partial => 'rule_priority', :locals => {:label => message('critical'), :css => 'odd', :priority_id => Sonar::RulePriority::PRIORITY_CRITICAL, :max => max, :measure => critical_violations }%> + <%= render :partial => 'rule_priority', :locals => {:label => message('major'), :css => 'even', :priority_id => Sonar::RulePriority::PRIORITY_MAJOR, :max => max, :measure => major_violations }%> + <%= render :partial => 'rule_priority', :locals => {:label => message('minor'), :css => 'odd', :priority_id => Sonar::RulePriority::PRIORITY_MINOR, :max => max, :measure => minor_violations }%> + <%= render :partial => 'rule_priority', :locals => {:label => message('info'), :css => 'even', :priority_id => Sonar::RulePriority::PRIORITY_INFO, :max => max, :measure => info_violations }%>
-

Rule

+

<%= message('rule') -%>

<% @@ -97,7 +97,7 @@ %> + <% end %>
- " title="Click for more on <%= rule.plugin_name -%>: <%= rule.plugin_rule_key -%>" onclick="window.open(this.href,'rule','height=800,width=900,scrollbars=1,resizable=1');return false;" href="<%= url_for :controller => 'rules', :action => 'show', :id => rule.key, :layout => 'false' -%>"> + " title="<%= message('drilldown.click_for_more_on_x', :params => [rule.plugin_name, rule.plugin_rule_key]) -%>" onclick="window.open(this.href,'rule','height=800,width=900,scrollbars=1,resizable=1');return false;" href="<%= url_for :controller => 'rules', :action => 'show', :id => rule.key, :layout => 'false' -%>"> <%= link_to(rule.name, {:overwrite_params => {:rule => rule.key, :sid => nil, :priority => Sonar::RulePriority.to_s(@priority_id)}}, :title => "#{rule.plugin_name}: #{rule.plugin_rule_key}") %> @@ -113,7 +113,7 @@ <% end %> <% if rule_index==0 %> -
No violations
<%= message('drilldown.no_violations') -%>
@@ -174,19 +174,19 @@
-Path: +<%= message('path') -%>: <% if @priority_id %> -<%= Sonar::RulePriority.to_s(@priority_id) %> <%= link_to 'clear', {:overwrite_params => {:priority => nil}} %> +<%= Sonar::RulePriority.to_s(@priority_id) %> <%= link_to message('clear_verb'), {:overwrite_params => {:priority => nil}} %> <% else %> -Any severity +<%= message('drilldown.any_severity') -%> <% end %> »  <% if @rule %> -<%= h @rule.name %> <%= link_to 'clear', {:overwrite_params => {:rule => nil}} %> +<%= h @rule.name %> <%= link_to message('clear_verb'), {:overwrite_params => {:rule => nil}} %> <% else %> -Any rule +<%= message('drilldown.any_rule') -%> <% end %> »  <% paths.each do |path| %> -<%= path[0] %> <%= link_to 'clear', {:overwrite_params => {:rids => path[1]}} %> »  +<%= path[0] %> <%= link_to message('clear_verb'), {:overwrite_params => {:rids => path[1]}} %> »  <% end %>