]> source.dussan.org Git - sonarqube.git/commitdiff
Fix rule parameter descriptions
authorDavid Gageot <david@gageot.net>
Wed, 10 Oct 2012 14:30:12 +0000 (16:30 +0200)
committerDavid Gageot <david@gageot.net>
Wed, 10 Oct 2012 14:30:44 +0000 (16:30 +0200)
sonar-server/src/main/webapp/WEB-INF/app/models/rules_parameter.rb
sonar-server/src/main/webapp/WEB-INF/app/views/rules_configuration/_rule_param.html.erb

index afee77ecbf449e220a42d8cc67ea31de1de7b656..05a5b2664cbf27d9c1e362651ab45cf472e3f75e 100644 (file)
@@ -33,6 +33,15 @@ class RulesParameter < ActiveRecord::Base
     param_type[2, param_type.length-3].split(",")
   end
 
+  def description
+    @l10n_description ||=
+      begin
+        result = Java::OrgSonarServerUi::JRubyFacade.instance.getRuleParamDescription(I18n.locale, rule.repository_key, rule.plugin_rule_key, name)
+        result = read_attribute(:description) unless result
+        result
+      end
+  end
+
   def description=(value)
     write_attribute(:description, value)
   end
index 7e35b07abd580b01b498fbd6ad7d9fc1a8e9b606..daba3972cafb2a293fee9ebdb90dc21c88af3694 100644 (file)
@@ -40,7 +40,7 @@
     <% end %>
   <% end %>
 
-  <div class="form-val-note"><%= h(parameter.rule.description || "") -%> <%= ('(' + readable_type(parameter.param_type) + ')') if !readable_type(parameter.param_type).empty? -%></div>
+  <div class="form-val-note"><%= h(parameter.description || "") -%> <%= ('(' + readable_type(parameter.param_type) + ')') if !readable_type(parameter.param_type).empty? -%></div>
 
   </form>
 </td>