]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-2589 Modification of all web ruby templates to use bundles
authorFabrice Bellingard <bellingard@gmail.com>
Tue, 19 Jul 2011 16:51:28 +0000 (18:51 +0200)
committerFabrice Bellingard <bellingard@gmail.com>
Tue, 19 Jul 2011 16:51:28 +0000 (18:51 +0200)
- Add I18n to widgets

25 files changed:
plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/AlertsWidget.java
plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/CodeCoverageWidget.java
plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/CommentsDuplicationsWidget.java
plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/ComplexityWidget.java
plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/CustomMeasuresWidget.java
plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/DescriptionWidget.java
plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/EventsWidget.java
plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/RulesWidget.java
plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/SizeWidget.java
plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/alerts.html.erb
plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/code_coverage.html.erb
plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/comments_duplications.html.erb
plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/complexity.html.erb
plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/description.html.erb
plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/rules.html.erb
plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/size.html.erb
plugins/sonar-design-plugin/src/main/java/org/sonar/plugins/design/ui/widgets/ChidamberKemererWidget.java
plugins/sonar-design-plugin/src/main/java/org/sonar/plugins/design/ui/widgets/FileDesignWidget.java
plugins/sonar-design-plugin/src/main/java/org/sonar/plugins/design/ui/widgets/PackageDesignWidget.java
plugins/sonar-design-plugin/src/main/resources/org/sonar/plugins/design/ui/widgets/chidamber_kemerer.html.erb
plugins/sonar-design-plugin/src/main/resources/org/sonar/plugins/design/ui/widgets/file_design.html.erb
plugins/sonar-design-plugin/src/main/resources/org/sonar/plugins/design/ui/widgets/package_design.html.erb
plugins/sonar-i18n-en-plugin/src/main/resources/org/sonar/i18n/core.properties
sonar-server/src/main/webapp/WEB-INF/app/models/project_link.rb
sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget_definition.html.erb

index 3f7933cea9d3747be6c9d85fe354bd9bf131c919..ddd71edbb035660500ca7415a9e2ec0e66a4898a 100644 (file)
  */
 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";
   }
index 5f9b6697f8d639ee65a25a3251c4f937c7629271..9be40a0e5cf13e5884b23395aa6c9a5a51b213c7 100644 (file)
 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";
   }
index a8f5fbeb7eff510e32a0ae4e76b0e0ffd551228f..0efbdb9c0163ca5ccf54c6b4cd61f76597ba40be 100644 (file)
 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";
   }
index cf955db69d32d952b8af4a65f486acfde44527c2..6d2d5922ae62c90231ab6d4e3fd0ae0ed605a6b0 100644 (file)
 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";
   }
index 89748942dda00b7ffdadf24562fa7a3a1f402376..8f340570fbd6f8b63bdac3ba888c5a394575a0d9 100644 (file)
@@ -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),
index 29957c6bae7844a56438f00a8e7fa0b21fa2a515..170d33e6a9bc8bd4b5627d466cea1178f6e277b9 100644 (file)
  */
 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";
   }
index 1c1ccc2775a16575494e4aac82e0933bba2db945..3911af76ab3d5ccc24decfb44526f06e6dc9c037 100644 (file)
 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";
   }
index 37acbe7955998bec1019aa44a8673cddbf0a5494..7f54f3abb36476e795dcc0cdff136db0c6cdcab5 100644 (file)
  */
 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";
   }
index b7ff7657d5f41b34dee6eedbb12c90fd7e60cb95..2b565c11218eb5971c8d77b3648d1f790c43d656 100644 (file)
 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";
   }
index 5304aaca9b4caf2494a8abc479cd0be89645ad44..dbf3dafdb9ec42bb4f0e3ece8155c7e611ad3f59 100644 (file)
@@ -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>
index 7dfc886a1a8a1c3b767bcab9d34773177de583ac..1df37a0994d80fd629176a83551069a856353d85 100644 (file)
@@ -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) -%>
         <% 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>
                 </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
   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 %>
index 49fd737da89972c6927b3cb0f4cf2760c6c2cd78..9d48758ef4c58ffb9e8b319847096133942e7ef4 100644 (file)
                <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>
                <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>
index d9721982b8418610fdf370f802aa9ee78200c0b2..fee7fef495e84f13262be65a347bbe36f0e2e851 100644 (file)
@@ -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>
index 2c445f8f2bfa1ebb1f73cec41618d614108190fd..758eb00d9869cf1cd1cd1ce06c6cedadde90d93d 100644 (file)
@@ -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 %>
       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/>
index ca4d29d18180d880b1b8025e88115b542a28c19d..456fdafdf17ac55850aa9afc1b24466544441279 100644 (file)
   <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> &nbsp;<%= link_to 'Blocker', {:controller => 'drilldown', :action => 'violations', :id => @project.key, :priority => 'BLOCKER'} %></td>
+                               <td> &nbsp;<%= 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> &nbsp;<%= link_to 'Critical', {:controller => 'drilldown', :action => 'violations', :id => @project.key, :priority => 'CRITICAL'} %></td>
+                               <td> &nbsp;<%= 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> &nbsp;<%= link_to 'Major', {:controller => 'drilldown', :action => 'violations', :id => @project.key, :priority => 'MAJOR'} %></td>
+                               <td> &nbsp;<%= 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>
                              </tr>
                              <tr>
                              <td><%= image_tag 'priority/MINOR.png'  %></td>
-                               <td> &nbsp;<%= link_to 'Minor', {:controller => 'drilldown', :action => 'violations', :id => @project.key, :priority => 'MINOR'} %></td>
+                               <td> &nbsp;<%= 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>
                              </tr>
                              <tr>
                              <td><%= image_tag 'priority/INFO.png'  %></td>
-                               <td> &nbsp;<%= link_to 'Info', {:controller => 'drilldown', :action => 'violations', :id => @project.key, :priority => 'INFO'} %></td>
+                               <td> &nbsp;<%= 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>
index d0d821feabd6614cfdfd036eec98e907a07c6eee..2cc728d1fa72cd0a238d2ee8458e3caacf5e356c 100644 (file)
@@ -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 %>
                              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>
                <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>
index ead27a5f51abefee7d6fb7ab71141674ae2ea53e..4107f294f4f1daec3b5758c240c7e1fe10d7a37b 100644 (file)
  */
 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
index 74ba2db32395151ac074342b208dddedda5ed9ba..ffc89a5f147854a3eb91795ad27115440d043e88 100644 (file)
  */
 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";
   }
index 9edd64ec741d31165964d5fe8419bb7c67efa9bb..995521f896e7190bd55cdf53e2bfd643071ca124 100644 (file)
  */
 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";
   }
index c23b968784b5ff051e3540a2f37c38d887e91e4a..7757aa180757cf49438fa51b0406a3a575913e55 100644 (file)
@@ -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>
index 512a743c133fd9f8e9967235c9cab4134df19f62..2fcac1fc7a9c1bd1e397017e5a3a72eee67efe2d 100644 (file)
@@ -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>
index 3e2611d33e5623571754b898b5cacbc6d3982696..ec4384a6c065096df48d556803d4604dfa540869 100644 (file)
     %>
       <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>
       <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>
index c2dc33a7b49b1987f8162ef5356f76b3df883ec0..35df5c65bdb7e0759282f7cee4b33407cd4f00f1 100644 (file)
@@ -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
index 422e45cbf55f708924c3c272aa09e6d28bcf69c4..d5079f420c466da88b5ec01de283ce89c8ce1c51 100644 (file)
@@ -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
index 5bacdff29347455ef5564c428cf4de15d7b6ddca..345f89f10d51e32ad8a9fcf5cbfe626b578149b8 100644 (file)
@@ -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>