diff options
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 = '<b>No alerts</b>.' + label = "<b>#{message('widget.alerts.no_alert')}</b>." else - label = "<b>Alerts</b> : #{h(m.alert_text)}." + label = "<b>#{message('widget.alerts.alerts')}</b> : #{h(m.alert_text)}." end %><div class="<%= css_class -%>" id="alerts_widget"> <div><%= format_measure(m) -%> <%= label -%></div> 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 @@ <tr> <td valign="top" width="50%" nowrap> <div class="dashbox"> - <p class="title">Code coverage</p> + <p class="title"><%= message('widget.code_coverage.title') -%></p> <p> <span class="big"><%= format_measure(code_coverage_measure, :suffix => '', :url => url_for_drilldown('coverage'), :default => '-') %></span> <%= 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 %> <p> - <%= 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) -%> </p> <% end %> <% branch_coverage=measure('branch_coverage') if branch_coverage %> <p> - <%= 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) -%> </p> <% end %> @@ -40,9 +40,9 @@ new_line_coverage=measure('new_line_coverage') new_branch_coverage=measure('new_branch_coverage') %> <br/> - <h3>On new code: </h3> + <h3><%= message('widget.code_coverage.on_new_code') -%>: </h3> <% if new_lines.to_i==0 %> - <p>No new lines to cover</p> + <p><%= message('widget.code_coverage.no_new_lines_to_cover') -%></p> <% else %> <% if new_coverage %> <p> @@ -50,16 +50,16 @@ </p> <% end %> <p> - <a href="<%= url_for_drilldown('new_lines_to_cover', :period => dashboard_configuration.period_index) -%>"><%= new_lines.to_i -%> lines to cover</a> + <a href="<%= url_for_drilldown('new_lines_to_cover', :period => dashboard_configuration.period_index) -%>"><%= new_lines.to_i -%><%= message('widget.code_coverage.lines_to_cover.suffix') -%></a> </p> <% if new_line_coverage %> <p> - <a href="<%= url_for_drilldown('new_uncovered_lines', :highlight => 'new_line_coverage', :period => dashboard_configuration.period_index) -%>"><%= new_line_coverage.format_numeric_value(variation_value(new_line_coverage))||'-' -%> line coverage</a> + <a href="<%= url_for_drilldown('new_uncovered_lines', :highlight => 'new_line_coverage', :period => dashboard_configuration.period_index) -%>"><%= new_line_coverage.format_numeric_value(variation_value(new_line_coverage))||'-' -%><%= message('widget.code_coverage.line_coverage.suffix') -%></a> </p> <% end %> <% if new_branch_coverage %> <p> - <a href="<%= url_for_drilldown('new_uncovered_conditions', :highlight => 'new_branch_coverage', :period => dashboard_configuration.period_index) -%>"><%= new_branch_coverage.format_numeric_value(variation_value(new_branch_coverage))||'-' -%> branch coverage</a> + <a href="<%= url_for_drilldown('new_uncovered_conditions', :highlight => 'new_branch_coverage', :period => dashboard_configuration.period_index) -%>"><%= new_branch_coverage.format_numeric_value(variation_value(new_branch_coverage))||'-' -%><%= message('widget.code_coverage.branch_coverage.suffix') -%></a> </p> <% end @@ -75,28 +75,28 @@ if tests_measure %> <div class="dashbox"> - <h3>Test success</h3> + <h3><%= message('widget.code_coverage.test_success') -%></h3> <p><span class="big"> <%= format_measure(success_percentage, :suffix => '', :url => url_for_drilldown(success_percentage)) %></span> <%= dashboard_configuration.selected_period? ? format_variation(success_percentage) : trend_icon(success_percentage) -%> </p> <p> - <%= 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) -%> </p> <p> - <%= 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) -%> </p> <p> - <%= 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) -%> </p> <% skipped_measure=measure(Metric::SKIPPED_TESTS) if dashboard_configuration.selected_period? || (skipped_measure && skipped_measure.value && skipped_measure.value>0) %> <p> - +<%= 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) -%> </p> <% 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 @@ <td valign="top" width="50%" nowrap> <% if (comment_lines) %> <div class="dashbox"> - <h3>Comments</h3> + <h3><%= message('widget.comments_duplications.comments') -%></h3> <p> <span class="big"><%= format_measure(comment_lines_density, :suffix => '', :url => url_for_drilldown(comment_lines_density)) %></span> <%= dashboard_configuration.selected_period? ? format_variation(comment_lines_density) : trend_icon(comment_lines_density) -%> </p> <p> - <%= 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) -%> </p> <% if comment_blank_lines && comment_blank_lines.value>0 %> - <p>+<%= format_measure(comment_blank_lines, :suffix => ' blank', :url => url_for_drilldown(comment_blank_lines)) %> + <p>+<%= 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) -%> </p> <% end %> <p> - <%= 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) -%> </p> <p> - <%= 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) -%> </p> <p> - <%= 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) -%> </p> </div> @@ -50,21 +50,21 @@ <td valign="top" width="50%" nowrap> <% if duplicated_lines_density %> <div class="dashbox"> - <h3>Duplications</h3> + <h3><%= message('widget.comments_duplications.duplications') -%></h3> <p> <span class="big"><%= format_measure(duplicated_lines_density, :suffix => '', :url => url_for_drilldown(Metric::DUPLICATED_LINES, :highlight => 'duplicated_lines_density')) %></span> <%= dashboard_configuration.selected_period? ? format_variation(duplicated_lines_density) : trend_icon(duplicated_lines_density) -%> </p> <p> - <%= 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) -%> </p> <p> - <%= 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) -%> </p> <p> - <%= 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) -%> </p> </div> 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') <tr> <td valign="top" width="50%"> <div class="dashbox" > - <h3>Complexity</h3> + <h3><%= message('widget.complexity.title') -%></h3> <% if function_complexity %> <p> - <span class="big"><%= format_measure(function_complexity, :suffix => '', :url => url_for_drilldown(function_complexity)) %></span> /method + <span class="big"><%= format_measure(function_complexity, :suffix => '', :url => url_for_drilldown(function_complexity)) %></span><%= message('widget.complexity.per_method.suffix') -%> <%= dashboard_configuration.selected_period? ? format_variation(function_complexity) : trend_icon(function_complexity) -%> </p> <% end %> <% if paragraph_complexity %> <p> - <span class="big"><%= format_measure(paragraph_complexity, :suffix => '', :url => url_for_drilldown(paragraph_complexity)) %></span> /paragraph + <span class="big"><%= format_measure(paragraph_complexity, :suffix => '', :url => url_for_drilldown(paragraph_complexity)) %></span><%= message('widget.complexity.per_paragraph.suffix') -%> <%= dashboard_configuration.selected_period? ? format_variation(paragraph_complexity) : trend_icon(paragraph_complexity) -%> </p> <% end %> <% if class_complexity %> <p> - <span class="big"><%= format_measure(class_complexity, :suffix => '', :url => url_for_drilldown(class_complexity)) %></span> /class + <span class="big"><%= format_measure(class_complexity, :suffix => '', :url => url_for_drilldown(class_complexity)) %></span></span><%= message('widget.complexity.per_class.suffix') -%> <%= dashboard_configuration.selected_period? ? format_variation(class_complexity) : trend_icon(class_complexity) -%> </p> <% end %> <% if file_complexity %> <p> - <span class="big"><%= format_measure(file_complexity, :suffix => '', :url => url_for_drilldown(file_complexity)) %></span> /file + <span class="big"><%= format_measure(file_complexity, :suffix => '', :url => url_for_drilldown(file_complexity)) %></span></span><%= message('widget.complexity.per_file.suffix') -%> <%= dashboard_configuration.selected_period? ? format_variation(file_complexity) : trend_icon(file_complexity) -%> </p> <% end %> <% if complexity %> <p> - 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) -%> </p> <% end %> </div> @@ -86,25 +86,25 @@ complexity=measure('complexity') if function_distribution count_dist+=1 %> -<input type="radio" name="cmp_dist" value="function_complexity_distribution" id="cmp_dist_function_complexity_distribution" onClick="selectComplexity('function_complexity_distribution');" <%= 'checked' if function_distribution==selected_distribution -%>></input> <label for="cmp_dist_function_complexity_distribution">Methods</label> +<input type="radio" name="cmp_dist" value="function_complexity_distribution" id="cmp_dist_function_complexity_distribution" onClick="selectComplexity('function_complexity_distribution');" <%= 'checked' if function_distribution==selected_distribution -%>></input> <label for="cmp_dist_function_complexity_distribution"><%= message('metric.functions.name') -%></label> <% end if paragraph_distribution count_dist+=1 %> -<input type="radio" name="cmp_dist" value="paragraph_complexity_distribution" id="cmp_dist_paragraph_complexity_distribution" onClick="selectComplexity('paragraph_complexity_distribution');" <%= 'checked' if paragraph_distribution==selected_distribution -%>></input> <label for="cmp_dist_paragraph_complexity_distribution">Paragraphs</label><%= '<br/>' if count_dist==2 %> +<input type="radio" name="cmp_dist" value="paragraph_complexity_distribution" id="cmp_dist_paragraph_complexity_distribution" onClick="selectComplexity('paragraph_complexity_distribution');" <%= 'checked' if paragraph_distribution==selected_distribution -%>></input> <label for="cmp_dist_paragraph_complexity_distribution"><%= message('metric.paragraphs.name') -%></label><%= '<br/>' if count_dist==2 %> <% end if class_distribution count_dist+=1 %> -<input type="radio" name="cmp_dist" value="class_complexity_distribution" id="cmp_dist_class_complexity_distribution" onClick="selectComplexity('class_complexity_distribution');" <%= 'checked' if class_distribution==selected_distribution -%>></input> <label for="cmp_dist_class_complexity_distribution">Classes</label><%= '<br/>' if count_dist==2 %> +<input type="radio" name="cmp_dist" value="class_complexity_distribution" id="cmp_dist_class_complexity_distribution" onClick="selectComplexity('class_complexity_distribution');" <%= 'checked' if class_distribution==selected_distribution -%>></input> <label for="cmp_dist_class_complexity_distribution"><%= message('metric.classes.name') -%></label><%= '<br/>' if count_dist==2 %> <% end if file_distribution count_dist+=1 %> -<input type="radio" name="cmp_dist" value="file_complexity_distribution" id="cmp_dist_file_complexity_distribution" onClick="selectComplexity('file_complexity_distribution');" <%= 'checked' if file_distribution==selected_distribution -%>></input> <label for="cmp_dist_file_complexity_distribution">Files</label> +<input type="radio" name="cmp_dist" value="file_complexity_distribution" id="cmp_dist_file_complexity_distribution" onClick="selectComplexity('file_complexity_distribution');" <%= 'checked' if file_distribution==selected_distribution -%>></input> <label for="cmp_dist_file_complexity_distribution"><%= message('metric.files.name') -%></label> <% end %> </form> 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 @@ <table class="width100 marginbottom10"> <tbody> <tr> - <td>Key: </td> + <td><%= message('widget.description.key') -%>: </td> <td id="resource_key"><%= @project.key -%></td> </tr> <% if @project.language %> <tr> - <td>Language: </td> + <td><%= message('widget.description.language') -%>: </td> <td id="resource_language"><%= @project.language -%></td> </tr> <% end %> @@ -20,19 +20,19 @@ if profile_measure %> <tr> - <td>Profile:</td> - <td><span id="resource_profile"><%= link_to profile_measure.data, {:controller => '/rules_configuration', :action => 'index', :id => profile_measure.value.to_i}, :id => 'profile_link' -%></span> (version <%= format_measure('profile_version', :default => '1') -%>)</td> + <td><%= message('widget.description.profile') -%>:</td> + <td><span id="resource_profile"><%= link_to profile_measure.data, {:controller => '/rules_configuration', :action => 'index', :id => profile_measure.value.to_i}, :id => 'profile_link' -%></span> (<%= message('widget.description.profile_version_x', :params => format_measure('profile_version', :default => '1')) -%>)</td> </tr> <% end %> <% if Project::SCOPE_SET==@project.scope %> <tr> - <td>Alerts: </td> - <td><%= image_tag 'rss-12x12.png' -%> <a href="<%= url_for :controller => :feeds, :action => 'project', :id => @project.key, :category => EventCategory::KEY_ALERT -%>" class="action">RSS Feed</a></td> + <td><%= message('widget.description.alerts') -%>: </td> + <td><%= image_tag 'rss-12x12.png' -%> <a href="<%= url_for :controller => :feeds, :action => 'project', :id => @project.key, :category => EventCategory::KEY_ALERT -%>" class="action"><%= message('widget.description.alerts_rss_feed') -%></a></td> </tr> <% end %> <% unless @project.project_links.empty? %> <tr> - <td valign="top">Links: </td> + <td valign="top"><%= message('widget.description.links') -%>: </td> <td id="resource_links"> <% @project.project_links.sort.each do |link| %> <%= link_to(image_tag(link.icon, :alt => link.name), link.href , :popup => true, :class => 'nolink') -%> <%= link_to(h(link.name), link.href, :popup => true) -%><br/> diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/rules.html.erb b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/rules.html.erb index ca4d29d1818..456fdafdf17 100644 --- a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/rules.html.erb +++ b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/rules.html.erb @@ -11,14 +11,14 @@ <tr> <td valign="top"> <div class="dashbox"> - <h3>Violations</h3> + <h3><%= message('widget.rules.violations') -%></h3> <div class="marginbottom10"> <span class="big"> <%= format_measure(violations, :url => url_for(:controller => 'drilldown', :action => 'violations', :id => @project.key)) -%> </span> <%= dashboard_configuration.selected_period? ? format_variation(violations) : trend_icon(violations) -%> </div> - <h3>Rules compliance</h3> + <h3><%= message('widget.rules.rules_compliance') -%></h3> <div> <span class="big"> <%= format_measure(density, :url => url_for_drilldown(Metric::WEIGHTED_VIOLATIONS, {:highlight => Metric::WEIGHTED_VIOLATIONS})) -%> @@ -40,7 +40,7 @@ <table class="clear width100"> <tr> <td><%= image_tag 'priority/BLOCKER.png'%></td> - <td> <%= link_to 'Blocker', {:controller => 'drilldown', :action => 'violations', :id => @project.key, :priority => 'BLOCKER'} %></td> + <td> <%= link_to message('blocker'), {:controller => 'drilldown', :action => 'violations', :id => @project.key, :priority => 'BLOCKER'} %></td> <td style="padding: 0 10px;" align="right"> <%= format_measure(blocker_violations) -%> </td> @@ -60,7 +60,7 @@ </tr> <tr> <td><%= image_tag 'priority/CRITICAL.png' %></td> - <td> <%= link_to 'Critical', {:controller => 'drilldown', :action => 'violations', :id => @project.key, :priority => 'CRITICAL'} %></td> + <td> <%= link_to message('critical'), {:controller => 'drilldown', :action => 'violations', :id => @project.key, :priority => 'CRITICAL'} %></td> <td style="padding: 0 10px;" align="right"> <%= format_measure(critical_violations) -%> </td> @@ -80,7 +80,7 @@ </tr> <tr> <td><%= image_tag 'priority/MAJOR.png' %></td> - <td> <%= link_to 'Major', {:controller => 'drilldown', :action => 'violations', :id => @project.key, :priority => 'MAJOR'} %></td> + <td> <%= link_to message('major'), {:controller => 'drilldown', :action => 'violations', :id => @project.key, :priority => 'MAJOR'} %></td> <td style="padding: 0 10px;" align="right"> <%= format_measure(major_violations) -%> </td> @@ -100,7 +100,7 @@ </tr> <tr> <td><%= image_tag 'priority/MINOR.png' %></td> - <td> <%= link_to 'Minor', {:controller => 'drilldown', :action => 'violations', :id => @project.key, :priority => 'MINOR'} %></td> + <td> <%= link_to message('minor'), {:controller => 'drilldown', :action => 'violations', :id => @project.key, :priority => 'MINOR'} %></td> <td style="padding: 0 10px;" align="right"> <%= format_measure(minor_violations) -%> </td> @@ -120,7 +120,7 @@ </tr> <tr> <td><%= image_tag 'priority/INFO.png' %></td> - <td> <%= link_to 'Info', {:controller => 'drilldown', :action => 'violations', :id => @project.key, :priority => 'INFO'} %></td> + <td> <%= link_to message('info'), {:controller => 'drilldown', :action => 'violations', :id => @project.key, :priority => 'INFO'} %></td> <td style="padding: 0 10px;" align="right"> <%= format_measure(info_violations) -%> </td> 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 @@ <tr> <td valign="top" width="48%" nowrap> <div class="dashbox"> - <h3>Lines of code</h3> + <h3><%= message('widget.size.lines_of_code') -%></h3> <% if ncloc %> <p> <span class="big"><%= format_measure(ncloc, :suffix => '', :url => url_for_drilldown(ncloc)) -%></span> @@ -23,9 +23,9 @@ generated_ncloc=measure('generated_ncloc') if generated_ncloc && generated_ncloc.value>0 %> - <p>+<%= format_measure(generated_ncloc, :suffix => ' generated', :url => url_for_drilldown(generated_ncloc)) -%> <%= dashboard_configuration.selected_period? ? format_variation(generated_ncloc) : trend_icon(generated_ncloc) -%></p> + <p>+<%= 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) -%></p> <% end %> - <p><%= format_measure(lines, :suffix => ' lines', :url => url_for_drilldown(lines)) -%> <%= dashboard_configuration.selected_period? ? format_variation(lines) : trend_icon(lines) -%></p> + <p><%= format_measure(lines, :suffix => message('widget.size.lines.suffix'), :url => url_for_drilldown(lines)) -%> <%= dashboard_configuration.selected_period? ? format_variation(lines) : trend_icon(lines) -%></p> <% else%> <p><span class="big"><%= format_measure(lines, :suffix => '', :url => url_for_drilldown(lines)) -%> <%= trend_icon(lines) -%></span></p> <% end %> @@ -33,15 +33,15 @@ generated_lines=measure('generated_lines') if generated_lines && generated_lines.value>0 %> - <p>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) -%></p> + <p>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) -%></p> <% end %> <% if statements %> <p> - <%= 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) -%> </p> <% end %> <% if files && measure('classes') %> - <p><%= format_measure(files, :suffix => ' files', :url => url_for_drilldown(files)) -%> <%= dashboard_configuration.selected_period? ? format_variation(files) : trend_icon(files) -%></p> + <p><%= format_measure(files, :suffix => message('widget.size.files.suffix'), :url => url_for_drilldown(files)) -%> <%= dashboard_configuration.selected_period? ? format_variation(files) : trend_icon(files) -%></p> <% end %> </div> </td> @@ -49,28 +49,28 @@ <td valign="top"> <div class="dashbox"> <% if classes %> - <h3>Classes</h3> + <h3><%= message('widget.size.classes') -%></h3> <p> <span class="big"><%= format_measure(classes, :url => url_for_drilldown(classes)) -%></span> <%= dashboard_configuration.selected_period? ? format_variation(classes) : trend_icon(classes) -%> </p> - <p><%= format_measure(packages, :suffix => ' packages', :url => url_for_drilldown(packages)) -%> <%= dashboard_configuration.selected_period? ? format_variation(packages) : trend_icon(packages) -%></p> + <p><%= format_measure(packages, :suffix => message('widget.size.packages.suffix'), :url => url_for_drilldown(packages)) -%> <%= dashboard_configuration.selected_period? ? format_variation(packages) : trend_icon(packages) -%></p> <% else %> - <h3>Files</h3> + <h3><%= message('widget.size.files') -%></h3> <p><span class="big"><%= format_measure(files, :url => url_for_drilldown(files)) -%></span> <%= dashboard_configuration.selected_period? ? format_variation(files) : trend_icon(files) -%> </p> - <p><%= format_measure('directories', :suffix => ' directories', :url => url_for_drilldown('directories')) -%> <%= dashboard_configuration.selected_period? ? format_variation('directories') : trend_icon('directories') -%></p> + <p><%= format_measure('directories', :suffix => message('widget.size.directories.suffix'), :url => url_for_drilldown('directories')) -%> <%= dashboard_configuration.selected_period? ? format_variation('directories') : trend_icon('directories') -%></p> <% end %> - <p><%= format_measure(functions, :suffix => ' methods', :url => url_for_drilldown(functions)) -%> <%= dashboard_configuration.selected_period? ? format_variation(functions) : trend_icon(functions) -%></p> + <p><%= format_measure(functions, :suffix => message('widget.size.methods.suffix'), :url => url_for_drilldown(functions)) -%> <%= dashboard_configuration.selected_period? ? format_variation(functions) : trend_icon(functions) -%></p> <% if (measure('accessors')) prefix=(dashboard_configuration.selected_period? ? '' : '+') %> - <p><%= format_measure('accessors', :prefix => prefix, :suffix => ' accessors', :url => url_for_drilldown('accessors')) -%> <%= dashboard_configuration.selected_period? ? format_variation('accessors') : trend_icon('accessors') -%></p> + <p><%= 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') -%></p> <% end %> <% if measure('paragraphs') %> - <p><%= format_measure('paragraphs', :suffix => ' paragraphs', :url => url_for_drilldown('paragraphs')) -%> <%= dashboard_configuration.selected_period? ? format_variation('paragraphs') : trend_icon('paragraphs') -%></p> + <p><%= format_measure('paragraphs', :suffix => message('widget.size.paragraphs.suffix'), :url => url_for_drilldown('paragraphs')) -%> <%= dashboard_configuration.selected_period? ? format_variation('paragraphs') : trend_icon('paragraphs') -%></p> <% end %> </div> </td> 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 %> <td width="50%" valign="top"> <div class="dashbox"> - <h3>LCOM4</h3> + <h3><%= message('widget.ckjm.lcom4') -%></h3> <p> - <span class="big"><%= format_measure(lcom, :suffix => '', :default => '-', :url => url_for_drilldown('lcom4')) -%></span> /class <%= dashboard_configuration.selected_period? ? format_variation(lcom) : trend_icon(lcom, :big => true) -%> + <span class="big"><%= format_measure(lcom, :suffix => '', :default => '-', :url => url_for_drilldown('lcom4')) -%></span><%= message('widget.ckjm.per_class.suffix') -%> <%= dashboard_configuration.selected_period? ? format_variation(lcom) : trend_icon(lcom, :big => true) -%> </p> <p> - <%= 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) -%> </p> </div> </td> @@ -25,9 +25,9 @@ if lcom || rfc <% if rfc %> <td width="50%" valign="top"> <div class="dashbox"> - <h3>RFC</h3> + <h3><%= message('widget.ckjm.rfc') -%></h3> <p><span class="big"> - <%= format_measure(rfc, :suffix => '', :default => '-', :url => url_for_drilldown('rfc')) -%></span> /class <%= dashboard_configuration.selected_period? ? format_variation(rfc) : trend_icon(rfc, :big => true) -%> + <%= format_measure(rfc, :suffix => '', :default => '-', :url => url_for_drilldown('rfc')) -%></span><%= message('widget.ckjm.per_class.suffix') -%> <%= dashboard_configuration.selected_period? ? format_variation(rfc) : trend_icon(rfc, :big => true) -%> </p> </div> </td> 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 @@ <tr> <td valign="top" width="50%"> <div class="dashbox"> - <p class="title">File tangle index</p> + <p class="title"><%= message('widget.file_design.file_tangle_index') -%></p> <p> <span class="big"><%= format_measure(file_tangle_index, :suffix => '', :default => '-', :url => url_for_drilldown('file_tangle_index')) -%></span> <%= dashboard_configuration.selected_period? ? format_variation(file_tangle_index) : trend_icon(file_tangle_index, :big => true) -%> </p> <% if file_cycles %> <p> - > <%= 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) -%> </p> <% end %> </div> @@ -23,7 +23,7 @@ <td valign="top" width="50%"> <% if file_feedback_edges %> <div class="dashbox"> - <p class="title">Suspect file dependencies</p> + <p class="title"><%= message('widget.file_design.suspect_file_dependencies') -%></p> <p> <span class="big"><%= format_measure(file_feedback_edges, :url => url_for_drilldown('file_feedback_edges')) -%></span> <%= dashboard_configuration.selected_period? ? format_variation(file_feedback_edges) : trend_icon(file_feedback_edges, :big => true) -%> </p> 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 @@ %> <td valign="top" width="50%"> <div class="dashbox"> - <p class="title">Package tangle index</p> + <p class="title"><%= message('widget.package_design.package_tangle_index') -%></p> <p> <span class="big"><%= format_measure(package_tangle_index, :suffix => '', :default => '-', :url => url_for_drilldown('package_tangle_index')) -%></span> <%= dashboard_configuration.selected_period? ? format_variation(package_tangle_index) : trend_icon(package_tangle_index, :big => true) -%> </p> <% if package_cycles %> <p> - > <%= 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) -%> </p> <% end %> </div> @@ -27,13 +27,13 @@ <td valign="top" width="50%"> <% if package_feedback_edges || package_tangles %> <div class="dashbox"> - <p class="title">Dependencies to cut</p> + <p class="title"><%= message('widget.package_design.dependencies_to_cut') -%></p> <p> - <%= 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) -%> </p> <p> - <%= 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) -%> </p> </div> 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 @@ -189,6 +170,20 @@ 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 # #------------------------------------------------------------------------------ @@ -316,6 +311,108 @@ 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 @@ <td> <div class="widget_def" id="def_<%= definition.getId().tr('_', '') -%>"> -<p><b><%= h definition.getTitle() -%></b></p> -<p><%= h definition.getDescription() -%></p> +<p><b><%= h message('widget.' + definition.getId() + '.title') -%></b></p> +<p><%= h message('widget.' + definition.getId() + '.description') -%></p> <%= form_tag :action => 'add_widget', :did => dashboard_id, :id => resource_id, :widget => definition.getId() %> <input type="submit" value="<%= message('dashboard.add_widget') -%>" > </form> |