From 7498e17be42112648345e20825ad84e6760b849b Mon Sep 17 00:00:00 2001 From: Fabrice Bellingard Date: Tue, 19 Jul 2011 18:51:28 +0200 Subject: [PATCH] SONAR-2589 Modification of all web ruby templates to use bundles - Add I18n to widgets --- .../plugins/core/widgets/AlertsWidget.java | 7 +- .../core/widgets/CodeCoverageWidget.java | 5 +- .../widgets/CommentsDuplicationsWidget.java | 3 +- .../core/widgets/ComplexityWidget.java | 3 +- .../core/widgets/CustomMeasuresWidget.java | 1 - .../core/widgets/DescriptionWidget.java | 7 +- .../plugins/core/widgets/EventsWidget.java | 3 +- .../plugins/core/widgets/RulesWidget.java | 8 +- .../plugins/core/widgets/SizeWidget.java | 3 +- .../plugins/core/widgets/alerts.html.erb | 4 +- .../core/widgets/code_coverage.html.erb | 26 ++-- .../widgets/comments_duplications.html.erb | 20 +-- .../plugins/core/widgets/complexity.html.erb | 20 +-- .../plugins/core/widgets/description.html.erb | 14 +- .../sonar/plugins/core/widgets/rules.html.erb | 14 +- .../sonar/plugins/core/widgets/size.html.erb | 26 ++-- .../ui/widgets/ChidamberKemererWidget.java | 11 +- .../design/ui/widgets/FileDesignWidget.java | 9 +- .../ui/widgets/PackageDesignWidget.java | 9 +- .../ui/widgets/chidamber_kemerer.html.erb | 10 +- .../design/ui/widgets/file_design.html.erb | 6 +- .../design/ui/widgets/package_design.html.erb | 10 +- .../resources/org/sonar/i18n/core.properties | 135 +++++++++++++++--- .../webapp/WEB-INF/app/models/project_link.rb | 8 ++ .../dashboard/_widget_definition.html.erb | 4 +- 25 files changed, 241 insertions(+), 125 deletions(-) diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/AlertsWidget.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/AlertsWidget.java index 3f7933cea9d..ddd71edbb03 100644 --- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/AlertsWidget.java +++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/AlertsWidget.java @@ -19,11 +19,14 @@ */ package org.sonar.plugins.core.widgets; -import org.sonar.api.web.*; +import org.sonar.api.web.AbstractRubyTemplate; +import org.sonar.api.web.RubyRailsWidget; +import org.sonar.api.web.WidgetLayout; +import org.sonar.api.web.WidgetLayoutType; @WidgetLayout(WidgetLayoutType.NONE) -@Description("Display current alerts on the project.") public class AlertsWidget extends AbstractRubyTemplate implements RubyRailsWidget { + public String getId() { return "alerts"; } diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/CodeCoverageWidget.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/CodeCoverageWidget.java index 5f9b6697f8d..9be40a0e5cf 100644 --- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/CodeCoverageWidget.java +++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/CodeCoverageWidget.java @@ -20,13 +20,12 @@ package org.sonar.plugins.core.widgets; import org.sonar.api.web.AbstractRubyTemplate; -import org.sonar.api.web.Description; import org.sonar.api.web.RubyRailsWidget; import org.sonar.api.web.WidgetCategory; -@WidgetCategory({"Tests"}) -@Description("Reports on units tests and code coverage by unit tests.") +@WidgetCategory({ "Tests" }) public class CodeCoverageWidget extends AbstractRubyTemplate implements RubyRailsWidget { + public String getId() { return "code_coverage"; } diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/CommentsDuplicationsWidget.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/CommentsDuplicationsWidget.java index a8f5fbeb7ef..0efbdb9c016 100644 --- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/CommentsDuplicationsWidget.java +++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/CommentsDuplicationsWidget.java @@ -20,11 +20,10 @@ package org.sonar.plugins.core.widgets; import org.sonar.api.web.AbstractRubyTemplate; -import org.sonar.api.web.Description; import org.sonar.api.web.RubyRailsWidget; -@Description("Reports on copy/paste and documentation") public class CommentsDuplicationsWidget extends AbstractRubyTemplate implements RubyRailsWidget { + public String getId() { return "comments_duplications"; } diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/ComplexityWidget.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/ComplexityWidget.java index cf955db69d3..6d2d5922ae6 100644 --- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/ComplexityWidget.java +++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/ComplexityWidget.java @@ -20,11 +20,10 @@ package org.sonar.plugins.core.widgets; import org.sonar.api.web.AbstractRubyTemplate; -import org.sonar.api.web.Description; import org.sonar.api.web.RubyRailsWidget; -@Description("Reports on complexity, average complexity and complexity distribution.") public class ComplexityWidget extends AbstractRubyTemplate implements RubyRailsWidget { + public String getId() { return "complexity"; } diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/CustomMeasuresWidget.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/CustomMeasuresWidget.java index 89748942dda..8f340570fbd 100644 --- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/CustomMeasuresWidget.java +++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/CustomMeasuresWidget.java @@ -22,7 +22,6 @@ package org.sonar.plugins.core.widgets; import org.sonar.api.web.*; @WidgetCategory({"Measures"}) -@Description("Select the measures to display") @WidgetProperties( { @WidgetProperty(key = "metric1", type = WidgetPropertyType.STRING), diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/DescriptionWidget.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/DescriptionWidget.java index 29957c6bae7..170d33e6a9b 100644 --- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/DescriptionWidget.java +++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/DescriptionWidget.java @@ -19,11 +19,14 @@ */ package org.sonar.plugins.core.widgets; -import org.sonar.api.web.*; +import org.sonar.api.web.AbstractRubyTemplate; +import org.sonar.api.web.RubyRailsWidget; +import org.sonar.api.web.WidgetLayout; +import org.sonar.api.web.WidgetLayoutType; @WidgetLayout(WidgetLayoutType.NONE) -@Description("Displays general project information") public class DescriptionWidget extends AbstractRubyTemplate implements RubyRailsWidget { + public String getId() { return "description"; } diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/EventsWidget.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/EventsWidget.java index 1c1ccc2775a..3911af76ab3 100644 --- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/EventsWidget.java +++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/EventsWidget.java @@ -20,11 +20,10 @@ package org.sonar.plugins.core.widgets; import org.sonar.api.web.AbstractRubyTemplate; -import org.sonar.api.web.Description; import org.sonar.api.web.RubyRailsWidget; -@Description("Reports events on the project life cycle such as versions and alerts.") public class EventsWidget extends AbstractRubyTemplate implements RubyRailsWidget { + public String getId() { return "events"; } diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/RulesWidget.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/RulesWidget.java index 37acbe79559..7f54f3abb36 100644 --- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/RulesWidget.java +++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/RulesWidget.java @@ -19,11 +19,13 @@ */ package org.sonar.plugins.core.widgets; -import org.sonar.api.web.*; +import org.sonar.api.web.AbstractRubyTemplate; +import org.sonar.api.web.RubyRailsWidget; +import org.sonar.api.web.WidgetCategory; -@WidgetCategory({"Rules"}) -@Description("Reports violations and compliance index on coding standards.") +@WidgetCategory({ "Rules" }) public class RulesWidget extends AbstractRubyTemplate implements RubyRailsWidget { + public String getId() { return "rules"; } diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/SizeWidget.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/SizeWidget.java index b7ff7657d5f..2b565c11218 100644 --- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/SizeWidget.java +++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/SizeWidget.java @@ -20,11 +20,10 @@ package org.sonar.plugins.core.widgets; import org.sonar.api.web.AbstractRubyTemplate; -import org.sonar.api.web.Description; import org.sonar.api.web.RubyRailsWidget; -@Description("Reports general metrics on the size of the project.") public class SizeWidget extends AbstractRubyTemplate implements RubyRailsWidget { + public String getId() { return "size"; } diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/alerts.html.erb b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/alerts.html.erb index 5304aaca9b4..dbf3dafdb9e 100644 --- a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/alerts.html.erb +++ b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/alerts.html.erb @@ -2,9 +2,9 @@ if m && !m.alert_status.blank? css_class = "widget color_#{m.alert_status}" if m.alert_status==Metric::TYPE_LEVEL_OK - label = 'No alerts.' + label = "#{message('widget.alerts.no_alert')}." else - label = "Alerts : #{h(m.alert_text)}." + label = "#{message('widget.alerts.alerts')} : #{h(m.alert_text)}." end %>
<%= format_measure(m) -%> <%= label -%>
diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/code_coverage.html.erb b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/code_coverage.html.erb index 7dfc886a1a8..1df37a0994d 100644 --- a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/code_coverage.html.erb +++ b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/code_coverage.html.erb @@ -10,7 +10,7 @@
-

Code coverage

+

<%= message('widget.code_coverage.title') -%>

<%= format_measure(code_coverage_measure, :suffix => '', :url => url_for_drilldown('coverage'), :default => '-') %> <%= dashboard_configuration.selected_period? ? format_variation(code_coverage_measure) : trend_icon(code_coverage_measure) -%> @@ -18,14 +18,14 @@ <% line_coverage=measure('line_coverage') if line_coverage %>

- <%= format_measure(line_coverage, :suffix => ' line coverage', :url => url_for_drilldown('uncovered_lines', :highlight => 'line_coverage')) %> + <%= format_measure(line_coverage, :suffix => message('widget.code_coverage.line_coverage.suffix'), :url => url_for_drilldown('uncovered_lines', :highlight => 'line_coverage')) %> <%= dashboard_configuration.selected_period? ? format_variation(line_coverage) : trend_icon(line_coverage) -%>

<% end %> <% branch_coverage=measure('branch_coverage') if branch_coverage %>

- <%= format_measure(branch_coverage, :suffix => ' branch coverage', :url => url_for_drilldown('uncovered_conditions', :highlight => 'branch_coverage')) %> + <%= format_measure(branch_coverage, :suffix => message('widget.code_coverage.branch_coverage.suffix'), :url => url_for_drilldown('uncovered_conditions', :highlight => 'branch_coverage')) %> <%= dashboard_configuration.selected_period? ? format_variation(branch_coverage) : trend_icon(branch_coverage) -%>

<% end %> @@ -40,9 +40,9 @@ new_line_coverage=measure('new_line_coverage') new_branch_coverage=measure('new_branch_coverage') %>
-

On new code:

+

<%= message('widget.code_coverage.on_new_code') -%>:

<% if new_lines.to_i==0 %> -

No new lines to cover

+

<%= message('widget.code_coverage.no_new_lines_to_cover') -%>

<% else %> <% if new_coverage %>

@@ -50,16 +50,16 @@

<% end %>

- <%= new_lines.to_i -%> lines to cover + <%= new_lines.to_i -%><%= message('widget.code_coverage.lines_to_cover.suffix') -%>

<% if new_line_coverage %>

- <%= new_line_coverage.format_numeric_value(variation_value(new_line_coverage))||'-' -%> line coverage + <%= new_line_coverage.format_numeric_value(variation_value(new_line_coverage))||'-' -%><%= message('widget.code_coverage.line_coverage.suffix') -%>

<% end %> <% if new_branch_coverage %>

- <%= new_branch_coverage.format_numeric_value(variation_value(new_branch_coverage))||'-' -%> branch coverage + <%= new_branch_coverage.format_numeric_value(variation_value(new_branch_coverage))||'-' -%><%= message('widget.code_coverage.branch_coverage.suffix') -%>

<% end @@ -75,28 +75,28 @@ if tests_measure %>
-

Test success

+

<%= message('widget.code_coverage.test_success') -%>

<%= format_measure(success_percentage, :suffix => '', :url => url_for_drilldown(success_percentage)) %> <%= dashboard_configuration.selected_period? ? format_variation(success_percentage) : trend_icon(success_percentage) -%>

- <%= format_measure(Metric::TEST_FAILURES, :suffix => ' failures', :url => url_for_drilldown(Metric::TEST_FAILURES)) %> + <%= format_measure(Metric::TEST_FAILURES, :suffix => message('widget.code_coverage.failures.suffix'), :url => url_for_drilldown(Metric::TEST_FAILURES)) %> <%= dashboard_configuration.selected_period? ? format_variation(Metric::TEST_FAILURES) : trend_icon(Metric::TEST_FAILURES) -%>

- <%= format_measure(Metric::TEST_ERRORS, :suffix => ' errors', :url => url_for_drilldown(Metric::TEST_ERRORS)) %> + <%= format_measure(Metric::TEST_ERRORS, :suffix => message('widget.code_coverage.errors.suffix'), :url => url_for_drilldown(Metric::TEST_ERRORS)) %> <%= dashboard_configuration.selected_period? ? format_variation(Metric::TEST_ERRORS) : trend_icon(Metric::TEST_ERRORS) -%>

- <%= format_measure(tests_measure, :suffix => ' tests', :url => url_for_drilldown('tests')) %> + <%= format_measure(tests_measure, :suffix => message('widget.code_coverage.tests.suffix'), :url => url_for_drilldown('tests')) %> <%= dashboard_configuration.selected_period? ? format_variation(tests_measure) : trend_icon(tests_measure) -%>

<% skipped_measure=measure(Metric::SKIPPED_TESTS) if dashboard_configuration.selected_period? || (skipped_measure && skipped_measure.value && skipped_measure.value>0) %>

- +<%= format_measure(skipped_measure, :suffix => ' skipped', :url => url_for_drilldown(Metric::SKIPPED_TESTS), :default => '0') %> + +<%= format_measure(skipped_measure, :suffix => message('widget.code_coverage.skipped.suffix'), :url => url_for_drilldown(Metric::SKIPPED_TESTS), :default => '0') %> <%= dashboard_configuration.selected_period? ? format_variation(skipped_measure) : trend_icon(skipped_measure) -%>

<% end %> diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/comments_duplications.html.erb b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/comments_duplications.html.erb index 49fd737da89..9d48758ef4c 100644 --- a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/comments_duplications.html.erb +++ b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/comments_duplications.html.erb @@ -16,32 +16,32 @@ <% if (comment_lines) %>
-

Comments

+

<%= message('widget.comments_duplications.comments') -%>

<%= format_measure(comment_lines_density, :suffix => '', :url => url_for_drilldown(comment_lines_density)) %> <%= dashboard_configuration.selected_period? ? format_variation(comment_lines_density) : trend_icon(comment_lines_density) -%>

- <%= format_measure(comment_lines, :suffix => ' lines', :url => url_for_drilldown(comment_lines)) %> + <%= format_measure(comment_lines, :suffix => message('widget.comments_duplications.lines.suffix'), :url => url_for_drilldown(comment_lines)) %> <%= dashboard_configuration.selected_period? ? format_variation(comment_lines) : trend_icon(comment_lines) -%>

<% if comment_blank_lines && comment_blank_lines.value>0 %> -

+<%= format_measure(comment_blank_lines, :suffix => ' blank', :url => url_for_drilldown(comment_blank_lines)) %> +

+<%= format_measure(comment_blank_lines, :suffix => message('widget.comments_duplications.blank.suffix'), :url => url_for_drilldown(comment_blank_lines)) %> <%= dashboard_configuration.selected_period? ? format_variation(comment_blank_lines) : trend_icon(comment_blank_lines) -%>

<% end %>

- <%= format_measure(public_documented_api_density, :suffix => ' docu. API', :url => url_for_drilldown(Metric::PUBLIC_UNDOCUMENTED_API, :highlight => Metric::PUBLIC_DOCUMENTED_API_DENSITY)) %> + <%= format_measure(public_documented_api_density, :suffix => message('widget.comments_duplications.docu_api.suffix'), :url => url_for_drilldown(Metric::PUBLIC_UNDOCUMENTED_API, :highlight => Metric::PUBLIC_DOCUMENTED_API_DENSITY)) %> <%= dashboard_configuration.selected_period? ? format_variation(public_documented_api_density) : trend_icon(public_documented_api_density) -%>

- <%= format_measure(public_undocumented_api, :suffix => ' undocu. API', :url => url_for_drilldown(public_undocumented_api)) %> + <%= format_measure(public_undocumented_api, :suffix => message('widget.comments_duplications.undocu_api.suffix'), :url => url_for_drilldown(public_undocumented_api)) %> <%= dashboard_configuration.selected_period? ? format_variation(public_undocumented_api) : trend_icon(public_undocumented_api) -%>

- <%= format_measure(commented_out_lines, :suffix => ' commented LOCs', :url => url_for_drilldown(commented_out_lines)) %> + <%= format_measure(commented_out_lines, :suffix => message('widget.comments_duplications.commented_locs.suffix'), :url => url_for_drilldown(commented_out_lines)) %> <%= dashboard_configuration.selected_period? ? format_variation(commented_out_lines) : trend_icon(commented_out_lines) -%>

@@ -50,21 +50,21 @@ <% if duplicated_lines_density %>
-

Duplications

+

<%= message('widget.comments_duplications.duplications') -%>

<%= format_measure(duplicated_lines_density, :suffix => '', :url => url_for_drilldown(Metric::DUPLICATED_LINES, :highlight => 'duplicated_lines_density')) %> <%= dashboard_configuration.selected_period? ? format_variation(duplicated_lines_density) : trend_icon(duplicated_lines_density) -%>

- <%= format_measure(duplicated_lines, :suffix => ' lines', :url => url_for_drilldown(duplicated_lines)) %> + <%= format_measure(duplicated_lines, :suffix => message('widget.comments_duplications.lines.suffix'), :url => url_for_drilldown(duplicated_lines)) %> <%= dashboard_configuration.selected_period? ? format_variation(duplicated_lines) : trend_icon(duplicated_lines) -%>

- <%= format_measure(duplicated_blocks, :suffix => ' blocks', :url => url_for_drilldown(duplicated_blocks)) %> + <%= format_measure(duplicated_blocks, :suffix => message('widget.comments_duplications.blocks.suffix'), :url => url_for_drilldown(duplicated_blocks)) %> <%= dashboard_configuration.selected_period? ? format_variation(duplicated_blocks) : trend_icon(duplicated_blocks) -%>

- <%= format_measure(duplicated_files, :suffix => ' files', :url => url_for_drilldown(duplicated_files)) %> + <%= format_measure(duplicated_files, :suffix => message('widget.comments_duplications.files.suffix'), :url => url_for_drilldown(duplicated_files)) %> <%= dashboard_configuration.selected_period? ? format_variation(duplicated_files) : trend_icon(duplicated_files) -%>

diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/complexity.html.erb b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/complexity.html.erb index d9721982b84..fee7fef495e 100644 --- a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/complexity.html.erb +++ b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/complexity.html.erb @@ -13,34 +13,34 @@ complexity=measure('complexity')
-

Complexity

+

<%= message('widget.complexity.title') -%>

<% if function_complexity %>

- <%= format_measure(function_complexity, :suffix => '', :url => url_for_drilldown(function_complexity)) %> /method + <%= format_measure(function_complexity, :suffix => '', :url => url_for_drilldown(function_complexity)) %><%= message('widget.complexity.per_method.suffix') -%> <%= dashboard_configuration.selected_period? ? format_variation(function_complexity) : trend_icon(function_complexity) -%>

<% end %> <% if paragraph_complexity %>

- <%= format_measure(paragraph_complexity, :suffix => '', :url => url_for_drilldown(paragraph_complexity)) %> /paragraph + <%= format_measure(paragraph_complexity, :suffix => '', :url => url_for_drilldown(paragraph_complexity)) %><%= message('widget.complexity.per_paragraph.suffix') -%> <%= dashboard_configuration.selected_period? ? format_variation(paragraph_complexity) : trend_icon(paragraph_complexity) -%>

<% end %> <% if class_complexity %>

- <%= format_measure(class_complexity, :suffix => '', :url => url_for_drilldown(class_complexity)) %> /class + <%= format_measure(class_complexity, :suffix => '', :url => url_for_drilldown(class_complexity)) %><%= message('widget.complexity.per_class.suffix') -%> <%= dashboard_configuration.selected_period? ? format_variation(class_complexity) : trend_icon(class_complexity) -%>

<% end %> <% if file_complexity %>

- <%= format_measure(file_complexity, :suffix => '', :url => url_for_drilldown(file_complexity)) %> /file + <%= format_measure(file_complexity, :suffix => '', :url => url_for_drilldown(file_complexity)) %><%= message('widget.complexity.per_file.suffix') -%> <%= dashboard_configuration.selected_period? ? format_variation(file_complexity) : trend_icon(file_complexity) -%>

<% end %> <% if complexity %>

- Total: <%= format_measure(complexity, :url => url_for_drilldown(complexity)) -%> <%= dashboard_configuration.selected_period? ? format_variation(complexity) : trend_icon(complexity) -%> + <%= message('widget.complexity.total') -%>: <%= format_measure(complexity, :url => url_for_drilldown(complexity)) -%> <%= dashboard_configuration.selected_period? ? format_variation(complexity) : trend_icon(complexity) -%>

<% end %>
@@ -86,25 +86,25 @@ complexity=measure('complexity') if function_distribution count_dist+=1 %> -> +> <% end if paragraph_distribution count_dist+=1 %> -> <%= '
' if count_dist==2 %> +> <%= '
' if count_dist==2 %> <% end if class_distribution count_dist+=1 %> -> <%= '
' if count_dist==2 %> +> <%= '
' if count_dist==2 %> <% end if file_distribution count_dist+=1 %> -> +> <% end %> diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/description.html.erb b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/description.html.erb index 2c445f8f2bf..758eb00d986 100644 --- a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/description.html.erb +++ b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/description.html.erb @@ -6,12 +6,12 @@ - + <% if @project.language %> - + <% end %> @@ -20,19 +20,19 @@ if profile_measure %> - - + + <% end %> <% if Project::SCOPE_SET==@project.scope %> - - + + <% end %> <% unless @project.project_links.empty? %> - +
Key: <%= message('widget.description.key') -%>: <%= @project.key -%>
Language: <%= message('widget.description.language') -%>: <%= @project.language -%>
Profile:<%= link_to profile_measure.data, {:controller => '/rules_configuration', :action => 'index', :id => profile_measure.value.to_i}, :id => 'profile_link' -%> (version <%= format_measure('profile_version', :default => '1') -%>)<%= message('widget.description.profile') -%>:<%= link_to profile_measure.data, {:controller => '/rules_configuration', :action => 'index', :id => profile_measure.value.to_i}, :id => 'profile_link' -%> (<%= message('widget.description.profile_version_x', :params => format_measure('profile_version', :default => '1')) -%>)
Alerts: <%= image_tag 'rss-12x12.png' -%> RSS Feed<%= message('widget.description.alerts') -%>: <%= image_tag 'rss-12x12.png' -%> <%= message('widget.description.alerts_rss_feed') -%>
Links: <%= message('widget.description.links') -%>:
-

Violations

+

<%= message('widget.rules.violations') -%>

<%= format_measure(violations, :url => url_for(:controller => 'drilldown', :action => 'violations', :id => @project.key)) -%> <%= dashboard_configuration.selected_period? ? format_variation(violations) : trend_icon(violations) -%>
-

Rules compliance

+

<%= message('widget.rules.rules_compliance') -%>

<%= format_measure(density, :url => url_for_drilldown(Metric::WEIGHTED_VIOLATIONS, {:highlight => Metric::WEIGHTED_VIOLATIONS})) -%> @@ -40,7 +40,7 @@ - + @@ -60,7 +60,7 @@ - + @@ -80,7 +80,7 @@ - + @@ -100,7 +100,7 @@ - + @@ -120,7 +120,7 @@ - + diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/size.html.erb b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/size.html.erb index d0d821feabd..2cc728d1fa7 100644 --- a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/size.html.erb +++ b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/size.html.erb @@ -13,7 +13,7 @@ @@ -49,28 +49,28 @@ diff --git a/plugins/sonar-design-plugin/src/main/java/org/sonar/plugins/design/ui/widgets/ChidamberKemererWidget.java b/plugins/sonar-design-plugin/src/main/java/org/sonar/plugins/design/ui/widgets/ChidamberKemererWidget.java index ead27a5f51a..4107f294f4f 100644 --- a/plugins/sonar-design-plugin/src/main/java/org/sonar/plugins/design/ui/widgets/ChidamberKemererWidget.java +++ b/plugins/sonar-design-plugin/src/main/java/org/sonar/plugins/design/ui/widgets/ChidamberKemererWidget.java @@ -19,18 +19,21 @@ */ package org.sonar.plugins.design.ui.widgets; -import org.sonar.api.web.*; +import org.sonar.api.web.AbstractRubyTemplate; +import org.sonar.api.web.RubyRailsWidget; +import org.sonar.api.web.UserRole; +import org.sonar.api.web.WidgetCategory; @UserRole(UserRole.USER) -@WidgetCategory({"Design"}) -@Description("Reports on LCOM4 and RFC average and distribution.") +@WidgetCategory({ "Design" }) public final class ChidamberKemererWidget extends AbstractRubyTemplate implements RubyRailsWidget { + public String getId() { return "ckjm"; } public String getTitle() { - return "Chidamber & Kemerer"; + return "Chidamber & Kemerer"; } @Override diff --git a/plugins/sonar-design-plugin/src/main/java/org/sonar/plugins/design/ui/widgets/FileDesignWidget.java b/plugins/sonar-design-plugin/src/main/java/org/sonar/plugins/design/ui/widgets/FileDesignWidget.java index 74ba2db3239..ffc89a5f147 100644 --- a/plugins/sonar-design-plugin/src/main/java/org/sonar/plugins/design/ui/widgets/FileDesignWidget.java +++ b/plugins/sonar-design-plugin/src/main/java/org/sonar/plugins/design/ui/widgets/FileDesignWidget.java @@ -19,12 +19,15 @@ */ package org.sonar.plugins.design.ui.widgets; -import org.sonar.api.web.*; +import org.sonar.api.web.AbstractRubyTemplate; +import org.sonar.api.web.RubyRailsWidget; +import org.sonar.api.web.UserRole; +import org.sonar.api.web.WidgetCategory; @UserRole(UserRole.USER) -@WidgetCategory({"Design"}) -@Description("Reports on files dependency cycles and tangle index.") +@WidgetCategory({ "Design" }) public final class FileDesignWidget extends AbstractRubyTemplate implements RubyRailsWidget { + public String getId() { return "file_design"; } diff --git a/plugins/sonar-design-plugin/src/main/java/org/sonar/plugins/design/ui/widgets/PackageDesignWidget.java b/plugins/sonar-design-plugin/src/main/java/org/sonar/plugins/design/ui/widgets/PackageDesignWidget.java index 9edd64ec741..995521f896e 100644 --- a/plugins/sonar-design-plugin/src/main/java/org/sonar/plugins/design/ui/widgets/PackageDesignWidget.java +++ b/plugins/sonar-design-plugin/src/main/java/org/sonar/plugins/design/ui/widgets/PackageDesignWidget.java @@ -19,12 +19,15 @@ */ package org.sonar.plugins.design.ui.widgets; -import org.sonar.api.web.*; +import org.sonar.api.web.AbstractRubyTemplate; +import org.sonar.api.web.RubyRailsWidget; +import org.sonar.api.web.UserRole; +import org.sonar.api.web.WidgetCategory; @UserRole(UserRole.USER) -@WidgetCategory({"Design"}) -@Description("Reports on package dependency cycles and tangle index.") +@WidgetCategory({ "Design" }) public final class PackageDesignWidget extends AbstractRubyTemplate implements RubyRailsWidget { + public String getId() { return "package_design"; } diff --git a/plugins/sonar-design-plugin/src/main/resources/org/sonar/plugins/design/ui/widgets/chidamber_kemerer.html.erb b/plugins/sonar-design-plugin/src/main/resources/org/sonar/plugins/design/ui/widgets/chidamber_kemerer.html.erb index c23b968784b..7757aa18075 100644 --- a/plugins/sonar-design-plugin/src/main/resources/org/sonar/plugins/design/ui/widgets/chidamber_kemerer.html.erb +++ b/plugins/sonar-design-plugin/src/main/resources/org/sonar/plugins/design/ui/widgets/chidamber_kemerer.html.erb @@ -12,12 +12,12 @@ if lcom || rfc <% if lcom %> @@ -25,9 +25,9 @@ if lcom || rfc <% if rfc %> diff --git a/plugins/sonar-design-plugin/src/main/resources/org/sonar/plugins/design/ui/widgets/file_design.html.erb b/plugins/sonar-design-plugin/src/main/resources/org/sonar/plugins/design/ui/widgets/file_design.html.erb index 512a743c133..2fcac1fc7a9 100644 --- a/plugins/sonar-design-plugin/src/main/resources/org/sonar/plugins/design/ui/widgets/file_design.html.erb +++ b/plugins/sonar-design-plugin/src/main/resources/org/sonar/plugins/design/ui/widgets/file_design.html.erb @@ -9,13 +9,13 @@
<%= image_tag 'priority/BLOCKER.png'%>  <%= link_to 'Blocker', {:controller => 'drilldown', :action => 'violations', :id => @project.key, :priority => 'BLOCKER'} %>  <%= link_to message('blocker'), {:controller => 'drilldown', :action => 'violations', :id => @project.key, :priority => 'BLOCKER'} %> <%= format_measure(blocker_violations) -%>
<%= image_tag 'priority/CRITICAL.png' %>  <%= link_to 'Critical', {:controller => 'drilldown', :action => 'violations', :id => @project.key, :priority => 'CRITICAL'} %>  <%= link_to message('critical'), {:controller => 'drilldown', :action => 'violations', :id => @project.key, :priority => 'CRITICAL'} %> <%= format_measure(critical_violations) -%>
<%= image_tag 'priority/MAJOR.png' %>  <%= link_to 'Major', {:controller => 'drilldown', :action => 'violations', :id => @project.key, :priority => 'MAJOR'} %>  <%= link_to message('major'), {:controller => 'drilldown', :action => 'violations', :id => @project.key, :priority => 'MAJOR'} %> <%= format_measure(major_violations) -%>
<%= image_tag 'priority/MINOR.png' %>  <%= link_to 'Minor', {:controller => 'drilldown', :action => 'violations', :id => @project.key, :priority => 'MINOR'} %>  <%= link_to message('minor'), {:controller => 'drilldown', :action => 'violations', :id => @project.key, :priority => 'MINOR'} %> <%= format_measure(minor_violations) -%>
<%= image_tag 'priority/INFO.png' %>  <%= link_to 'Info', {:controller => 'drilldown', :action => 'violations', :id => @project.key, :priority => 'INFO'} %>  <%= link_to message('info'), {:controller => 'drilldown', :action => 'violations', :id => @project.key, :priority => 'INFO'} %> <%= format_measure(info_violations) -%>
-

Lines of code

+

<%= message('widget.size.lines_of_code') -%>

<% if ncloc %>

<%= format_measure(ncloc, :suffix => '', :url => url_for_drilldown(ncloc)) -%> @@ -23,9 +23,9 @@ generated_ncloc=measure('generated_ncloc') if generated_ncloc && generated_ncloc.value>0 %> -

+<%= format_measure(generated_ncloc, :suffix => ' generated', :url => url_for_drilldown(generated_ncloc)) -%> <%= dashboard_configuration.selected_period? ? format_variation(generated_ncloc) : trend_icon(generated_ncloc) -%>

+

+<%= format_measure(generated_ncloc, :suffix => message('widget.size.generated.suffix'), :url => url_for_drilldown(generated_ncloc)) -%> <%= dashboard_configuration.selected_period? ? format_variation(generated_ncloc) : trend_icon(generated_ncloc) -%>

<% end %> -

<%= format_measure(lines, :suffix => ' lines', :url => url_for_drilldown(lines)) -%> <%= dashboard_configuration.selected_period? ? format_variation(lines) : trend_icon(lines) -%>

+

<%= format_measure(lines, :suffix => message('widget.size.lines.suffix'), :url => url_for_drilldown(lines)) -%> <%= dashboard_configuration.selected_period? ? format_variation(lines) : trend_icon(lines) -%>

<% else%>

<%= format_measure(lines, :suffix => '', :url => url_for_drilldown(lines)) -%> <%= trend_icon(lines) -%>

<% end %> @@ -33,15 +33,15 @@ generated_lines=measure('generated_lines') if generated_lines && generated_lines.value>0 %> -

incl. <%= format_measure(generated_lines, :suffix => ' generated', :url => url_for_drilldown(generated_lines)) -%> <%= dashboard_configuration.selected_period? ? format_variation(generated_lines) : trend_icon(generated_lines) -%>

+

incl. <%= format_measure(generated_lines, :suffix => message('widget.size.generated.suffix'), :url => url_for_drilldown(generated_lines)) -%> <%= dashboard_configuration.selected_period? ? format_variation(generated_lines) : trend_icon(generated_lines) -%>

<% end %> <% if statements %>

- <%= format_measure(statements, :suffix => ' statements', :url => url_for_drilldown(statements)) -%> <%= dashboard_configuration.selected_period? ? format_variation(statements) : trend_icon(statements) -%> + <%= format_measure(statements, :suffix => message('widget.size.statements.suffix'), :url => url_for_drilldown(statements)) -%> <%= dashboard_configuration.selected_period? ? format_variation(statements) : trend_icon(statements) -%>

<% end %> <% if files && measure('classes') %> -

<%= format_measure(files, :suffix => ' files', :url => url_for_drilldown(files)) -%> <%= dashboard_configuration.selected_period? ? format_variation(files) : trend_icon(files) -%>

+

<%= format_measure(files, :suffix => message('widget.size.files.suffix'), :url => url_for_drilldown(files)) -%> <%= dashboard_configuration.selected_period? ? format_variation(files) : trend_icon(files) -%>

<% end %>
<% if classes %> -

Classes

+

<%= message('widget.size.classes') -%>

<%= format_measure(classes, :url => url_for_drilldown(classes)) -%> <%= dashboard_configuration.selected_period? ? format_variation(classes) : trend_icon(classes) -%>

-

<%= format_measure(packages, :suffix => ' packages', :url => url_for_drilldown(packages)) -%> <%= dashboard_configuration.selected_period? ? format_variation(packages) : trend_icon(packages) -%>

+

<%= format_measure(packages, :suffix => message('widget.size.packages.suffix'), :url => url_for_drilldown(packages)) -%> <%= dashboard_configuration.selected_period? ? format_variation(packages) : trend_icon(packages) -%>

<% else %> -

Files

+

<%= message('widget.size.files') -%>

<%= format_measure(files, :url => url_for_drilldown(files)) -%> <%= dashboard_configuration.selected_period? ? format_variation(files) : trend_icon(files) -%>

-

<%= format_measure('directories', :suffix => ' directories', :url => url_for_drilldown('directories')) -%> <%= dashboard_configuration.selected_period? ? format_variation('directories') : trend_icon('directories') -%>

+

<%= format_measure('directories', :suffix => message('widget.size.directories.suffix'), :url => url_for_drilldown('directories')) -%> <%= dashboard_configuration.selected_period? ? format_variation('directories') : trend_icon('directories') -%>

<% end %> -

<%= format_measure(functions, :suffix => ' methods', :url => url_for_drilldown(functions)) -%> <%= dashboard_configuration.selected_period? ? format_variation(functions) : trend_icon(functions) -%>

+

<%= format_measure(functions, :suffix => message('widget.size.methods.suffix'), :url => url_for_drilldown(functions)) -%> <%= dashboard_configuration.selected_period? ? format_variation(functions) : trend_icon(functions) -%>

<% if (measure('accessors')) prefix=(dashboard_configuration.selected_period? ? '' : '+') %> -

<%= format_measure('accessors', :prefix => prefix, :suffix => ' accessors', :url => url_for_drilldown('accessors')) -%> <%= dashboard_configuration.selected_period? ? format_variation('accessors') : trend_icon('accessors') -%>

+

<%= format_measure('accessors', :prefix => prefix, :suffix => message('widget.size.accessors.suffix'), :url => url_for_drilldown('accessors')) -%> <%= dashboard_configuration.selected_period? ? format_variation('accessors') : trend_icon('accessors') -%>

<% end %> <% if measure('paragraphs') %> -

<%= format_measure('paragraphs', :suffix => ' paragraphs', :url => url_for_drilldown('paragraphs')) -%> <%= dashboard_configuration.selected_period? ? format_variation('paragraphs') : trend_icon('paragraphs') -%>

+

<%= format_measure('paragraphs', :suffix => message('widget.size.paragraphs.suffix'), :url => url_for_drilldown('paragraphs')) -%> <%= dashboard_configuration.selected_period? ? format_variation('paragraphs') : trend_icon('paragraphs') -%>

<% end %>
-

LCOM4

+

<%= message('widget.ckjm.lcom4') -%>

- <%= format_measure(lcom, :suffix => '', :default => '-', :url => url_for_drilldown('lcom4')) -%> /class <%= dashboard_configuration.selected_period? ? format_variation(lcom) : trend_icon(lcom, :big => true) -%> + <%= format_measure(lcom, :suffix => '', :default => '-', :url => url_for_drilldown('lcom4')) -%><%= message('widget.ckjm.per_class.suffix') -%> <%= dashboard_configuration.selected_period? ? format_variation(lcom) : trend_icon(lcom, :big => true) -%>

- <%= format_measure(suspect_lcom4_density, :suffix => ' files having LCOM4>1', :url => url_for_drilldown('lcom4')) %> <%= dashboard_configuration.selected_period? ? format_variation(suspect_lcom4_density) : trend_icon(suspect_lcom4_density) -%> + <%= format_measure(suspect_lcom4_density, :suffix => message('widget.ckjm.files_having_lcom_greater_than_one'), :url => url_for_drilldown('lcom4')) %> <%= dashboard_configuration.selected_period? ? format_variation(suspect_lcom4_density) : trend_icon(suspect_lcom4_density) -%>

-

RFC

+

<%= message('widget.ckjm.rfc') -%>

- <%= format_measure(rfc, :suffix => '', :default => '-', :url => url_for_drilldown('rfc')) -%> /class <%= dashboard_configuration.selected_period? ? format_variation(rfc) : trend_icon(rfc, :big => true) -%> + <%= format_measure(rfc, :suffix => '', :default => '-', :url => url_for_drilldown('rfc')) -%><%= message('widget.ckjm.per_class.suffix') -%> <%= dashboard_configuration.selected_period? ? format_variation(rfc) : trend_icon(rfc, :big => true) -%>

-

File tangle index

+

<%= message('widget.file_design.file_tangle_index') -%>

<%= format_measure(file_tangle_index, :suffix => '', :default => '-', :url => url_for_drilldown('file_tangle_index')) -%> <%= dashboard_configuration.selected_period? ? format_variation(file_tangle_index) : trend_icon(file_tangle_index, :big => true) -%>

<% if file_cycles %>

- > <%= format_measure(file_cycles, :suffix => ' cycles', :url => url_for_drilldown('file_cycles')) %> <%= dashboard_configuration.selected_period? ? format_variation(file_cycles) : trend_icon(file_cycles) -%> + > <%= format_measure(file_cycles, :suffix => message('widget.file_design.cycles.suffix'), :url => url_for_drilldown('file_cycles')) %> <%= dashboard_configuration.selected_period? ? format_variation(file_cycles) : trend_icon(file_cycles) -%>

<% end %>
@@ -23,7 +23,7 @@
<% if file_feedback_edges %>
-

Suspect file dependencies

+

<%= message('widget.file_design.suspect_file_dependencies') -%>

<%= format_measure(file_feedback_edges, :url => url_for_drilldown('file_feedback_edges')) -%> <%= dashboard_configuration.selected_period? ? format_variation(file_feedback_edges) : trend_icon(file_feedback_edges, :big => true) -%>

diff --git a/plugins/sonar-design-plugin/src/main/resources/org/sonar/plugins/design/ui/widgets/package_design.html.erb b/plugins/sonar-design-plugin/src/main/resources/org/sonar/plugins/design/ui/widgets/package_design.html.erb index 3e2611d33e5..ec4384a6c06 100644 --- a/plugins/sonar-design-plugin/src/main/resources/org/sonar/plugins/design/ui/widgets/package_design.html.erb +++ b/plugins/sonar-design-plugin/src/main/resources/org/sonar/plugins/design/ui/widgets/package_design.html.erb @@ -13,13 +13,13 @@ %>
-

Package tangle index

+

<%= message('widget.package_design.package_tangle_index') -%>

<%= format_measure(package_tangle_index, :suffix => '', :default => '-', :url => url_for_drilldown('package_tangle_index')) -%> <%= dashboard_configuration.selected_period? ? format_variation(package_tangle_index) : trend_icon(package_tangle_index, :big => true) -%>

<% if package_cycles %>

- > <%= format_measure(package_cycles, :suffix => ' cycles', :url => url_for_drilldown('package_cycles')) %> <%= dashboard_configuration.selected_period? ? format_variation(package_cycles) : trend_icon(package_cycles) -%> + > <%= format_measure(package_cycles, :suffix => message('widget.package_design.cycles.suffix'), :url => url_for_drilldown('package_cycles')) %> <%= dashboard_configuration.selected_period? ? format_variation(package_cycles) : trend_icon(package_cycles) -%>

<% end %>
@@ -27,13 +27,13 @@
<% if package_feedback_edges || package_tangles %>
-

Dependencies to cut

+

<%= message('widget.package_design.dependencies_to_cut') -%>

- <%= format_measure(package_feedback_edges, :suffix => ' between packages', :url => url_for_drilldown('package_feedback_edges')) %> + <%= format_measure(package_feedback_edges, :suffix => message('widget.package_design.between_packages.suffix'), :url => url_for_drilldown('package_feedback_edges')) %> <%= dashboard_configuration.selected_period? ? format_variation(package_feedback_edges) : trend_icon(package_feedback_edges) -%>

- <%= format_measure(package_tangles, :suffix => ' between files', :url => url_for_drilldown('package_tangles')) %> + <%= format_measure(package_tangles, :suffix => message('widget.package_design.between_files.suffix'), :url => url_for_drilldown('package_tangles')) %> <%= dashboard_configuration.selected_period? ? format_variation(package_tangles) : trend_icon(package_tangles) -%>

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 c2dc33a7b49..35df5c65bdb 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 @@ -1,22 +1,3 @@ -view.coverage.title=Coverage -view.org.sonar.plugins.core.duplicationsviewer.DuplicationsViewer.title=Duplications -view.source.title=Source -view.violations.title=Violations - -view.size.lines_of_code=Lines of code -view.size.classes=Classes -view.size.files=Files -view.size.generated_suffix=\ generated -view.size.lines_suffix=\ lines -view.size.statements_suffix=\ statements -view.size.files_suffix=\ files -view.size.packages_suffix=\ packages -view.size.directories_suffix=\ directories -view.size.methods_suffix=\ methods -view.size.accessors_suffix=\ accessors -view.size.paragraphs_suffix=\ paragraphs - - #------------------------------------------------------------------------------ # # GENERIC WORDS, sorted alphabetically @@ -187,6 +168,20 @@ time_changes=Time changes update_comment=Update comment +#------------------------------------------------------------------------------ +# +# PROJECT LINKS +# +#------------------------------------------------------------------------------ + +project_links.homepage=Home +project_links.ci=Continuous integration +project_links.issue=Issues +project_links.scm=Sources +project_links.scm_ro=Read-only connection +project_links.scm_dev=Developer connection + + #------------------------------------------------------------------------------ # # LAYOUT @@ -314,6 +309,108 @@ dashboard.edit_dashboard=Edit dashboard dashboard.update_dashboard=Update dashboard +#------------------------------------------------------------------------------ +# +# WIDGETS +# +#------------------------------------------------------------------------------ + +widget.alerts.title=Alerts +widget.alerts.description=Display current alerts on the project. +widget.alerts.no_alert=No alerts +widget.alerts.alerts=Alerts + +widget.code_coverage.title=Code coverage +widget.code_coverage.description=Reports on units tests and code coverage by unit tests. +widget.code_coverage.line_coverage.suffix=\ line coverage +widget.code_coverage.branch_coverage.suffix=\ branch coverage +widget.code_coverage.lines_to_cover.suffix=\ lines to cover +widget.code_coverage.on_new_code=On new code +widget.code_coverage.no_new_lines_to_cover=No new lines to cover +widget.code_coverage.test_success=Test success +widget.code_coverage.failures.suffix=\ failures +widget.code_coverage.errors.suffix=\ errors +widget.code_coverage.tests.suffix=\ tests +widget.code_coverage.skipped.suffix=\ skipped + +widget.comments_duplications.title=Comments & Duplications +widget.comments_duplications.description=Reports on copy/paste and documentation +widget.comments_duplications.comments=Comments +widget.comments_duplications.lines.suffix=\ lines +widget.comments_duplications.blank.suffix=\ blank +widget.comments_duplications.docu_api.suffix=\ docu. API +widget.comments_duplications.undocu_api.suffix=\ undocu. API +widget.comments_duplications.commented_locs.suffix=\ commented LOCs +widget.comments_duplications.duplications=Duplications +widget.comments_duplications.blocks.suffix=\ blocs +widget.comments_duplications.files.suffix=\ files + +widget.complexity.title=Complexity +widget.complexity.description=Reports on complexity, average complexity and complexity distribution. +widget.complexity.per_method.suffix=\ /method +widget.complexity.per_paragraph.suffix=\ /paragraph +widget.complexity.per_class.suffix=\ /class +widget.complexity.per_file.suffix=\ /file +widget.complexity.total=Total + +widget.custom_measures.title=Custom Measures +widget.custom_measures.description=Select the measures to display + +widget.description.title=Description +widget.description.description=Displays general project information +widget.description.key=Key +widget.description.language=Language +widget.description.profile=Profile +widget.description.profile_version_x=version {0} +widget.description.alerts=Alerts +widget.description.alerts_rss_feed=RSS Feed +widget.description.links=Links + +widget.events.title=Events +widget.events.description=Reports events on the project life cycle such as versions and alerts. + +widget.rules.title=Rules Compliance +widget.rules.description=Reports violations and compliance index on coding standards. +widget.rules.violations=Violations +widget.rules.rules_compliance=Rules compliance + +widget.size.title=Size metrics +widget.size.description=Reports general metrics on the size of the project. +widget.size.lines_of_code=Lines of code +widget.size.generated.suffix=\ generated +widget.size.lines.suffix=\ lines +widget.size.statements.suffix=\ statements +widget.size.files.suffix=\ files +widget.size.classes=Classes +widget.size.files=Files +widget.size.packages.suffix=\ packages +widget.size.directories.suffix=\ directories +widget.size.methods.suffix=\ methods +widget.size.accessors.suffix=\ accessors +widget.size.paragraphs.suffix=\ paragraphs + +widget.ckjm.title=Chidamber & Kemerer +widget.ckjm.description=Reports on LCOM4 and RFC average and distribution. +widget.ckjm.lcom4=LCOM4 +widget.ckjm.per_class.suffix=\ /class +widget.ckjm.files_having_lcom_greater_than_one=\ files having LCOM4>1 +widget.ckjm.rfc=RFC + +widget.file_design.title=File design +widget.file_design.description=Reports on files dependency cycles and tangle index. +widget.file_design.file_tangle_index=File tangle index +widget.file_design.cycles.suffix=\ cycles +widget.file_design.suspect_file_dependencies=Suspect file dependencies + +widget.package_design.title=Package design +widget.package_design.description=Reports on package dependency cycles and tangle index. +widget.package_design.package_tangle_index=Package tangle index +widget.package_design.cycles.suffix=\ cycles +widget.package_design.dependencies_to_cut=Dependencies to cut +widget.package_design.between_packages.suffix=\ between packages +widget.package_design.between_files.suffix=\ between files + + #------------------------------------------------------------------------------ # # COMPONENTS diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/project_link.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/project_link.rb index 422e45cbf55..d5079f420c4 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/models/project_link.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/models/project_link.rb @@ -41,6 +41,14 @@ class ProjectLink < ActiveRecord::Base link_type end + def name(translate=true) + default_string = read_attribute(:name) + return default_string unless translate + + i18n_key = 'project_links.' + read_attribute(:link_type) + Java::OrgSonarServerUi::JRubyFacade.getInstance().getI18nMessage(I18n.locale, i18n_key, default_string, [].to_java) + end + def self.name_to_key(s) s.tr(' ', '_')[0..19] end diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget_definition.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget_definition.html.erb index 5bacdff2934..345f89f10d5 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget_definition.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget_definition.html.erb @@ -1,7 +1,7 @@
-

<%= h definition.getTitle() -%>

-

<%= h definition.getDescription() -%>

+

<%= h message('widget.' + definition.getId() + '.title') -%>

+

<%= h message('widget.' + definition.getId() + '.description') -%>

<%= form_tag :action => 'add_widget', :did => dashboard_id, :id => resource_id, :widget => definition.getId() %> -- 2.39.5