diff options
author | Fabrice Bellingard <bellingard@gmail.com> | 2011-07-19 18:51:28 +0200 |
---|---|---|
committer | Fabrice Bellingard <bellingard@gmail.com> | 2011-07-19 18:51:28 +0200 |
commit | 7498e17be42112648345e20825ad84e6760b849b (patch) | |
tree | 747baf0f86ea3bf032d9874165f9bc3e7b75dd79 /plugins/sonar-design-plugin/src | |
parent | 543aee63f3f5fa52cd34be4565085ce895b9e8bf (diff) | |
download | sonarqube-7498e17be42112648345e20825ad84e6760b849b.tar.gz sonarqube-7498e17be42112648345e20825ad84e6760b849b.zip |
SONAR-2589 Modification of all web ruby templates to use bundles
- Add I18n to widgets
Diffstat (limited to 'plugins/sonar-design-plugin/src')
6 files changed, 32 insertions, 23 deletions
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> |