]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-2716 Support localization of plugin properties
authorsimonbrandhof <simon.brandhof@gmail.com>
Tue, 16 Aug 2011 20:43:26 +0000 (22:43 +0200)
committersimonbrandhof <simon.brandhof@gmail.com>
Tue, 16 Aug 2011 20:43:40 +0000 (22:43 +0200)
plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/core.properties
plugins/sonar-surefire-plugin/src/test/java/org/sonar/plugins/surefire/FooTest.java [deleted file]
sonar-server/src/main/webapp/WEB-INF/app/views/settings/_plugins.html.erb

index 4d5541356c2c61c21e03c04a8f9b91e40119f5c0..e4880af457bc7c7d81558de427266628c0a58603 100644 (file)
@@ -420,7 +420,7 @@ dashboard.update_dashboard=Update dashboard
 #
 #------------------------------------------------------------------------------
 settings.save_category=Save {0} settings
-settings.category.General=General
+property.category.General=General
 
 
 
diff --git a/plugins/sonar-surefire-plugin/src/test/java/org/sonar/plugins/surefire/FooTest.java b/plugins/sonar-surefire-plugin/src/test/java/org/sonar/plugins/surefire/FooTest.java
deleted file mode 100644 (file)
index aae1f11..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Sonar, open source software quality management tool.
- * Copyright (C) 2008-2011 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * Sonar is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * Sonar is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Sonar; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02
- */
-package org.sonar.plugins.surefire;
-
-import org.junit.Test;
-import org.junit.experimental.runners.Enclosed;
-import org.junit.runner.RunWith;
-
-@RunWith(Enclosed.class)
-public class FooTest  {
-
-  @RunWith(Enclosed.class)
-  public static class Inner1 {
-
-    public static class Run {
-      @Test
-      public void test1() {}
-    }
-  }
-
-  @RunWith(Enclosed.class)
-  public static class Inner2 {
-
-    public static class Run {
-      @Test
-      public void test2() {}
-    }
-  }
-}
\ No newline at end of file
index 59e305d9573c36cef37e5ef40cf7e01f4240516a..b56c661fdf2a1c3715df62d37d61a105ee1742a2 100644 (file)
@@ -48,7 +48,7 @@
                unless @properties_per_category[category].empty?
           %>
               <tr class="select <%= cycle('even', 'odd', :name => 'category') -%> <%= 'selected' if @category==category -%>" id="select_<%= category -%>">
-                <td><%= link_to h(category), :overwrite_params => {:category => category} -%></td>
+                <td><%= link_to message("property.category.#{category}", :default => category), :overwrite_params => {:category => category} -%></td>
               </tr>
             <% end
                end
@@ -60,7 +60,7 @@
 
       <td class="column">
         <% if @category
-          category_name = message("settings.category.#{@category}", :default => @category)
+          category_name = message("property.category.#{@category}", :default => @category)
         %>
 
           <% form_tag :controller => :settings, :action => :update do %>
                 <tr class="<%= cycle('even', 'odd', :name => 'properties') -%>">
                   <td style="padding:  10px">
                     <h3>
-                      <%= h(property.name()) -%>
+                      <%= message("property.#{property.key()}.name", :default => property.name()) -%>
                       <% if property.project() %>
                         <br/><span class="note"><%= property.key() -%></span>
                       <% end %>
                     </h3>
-                    <% if property.description.present? %>
-                      <p class="marginbottom10"><%= property.description -%></p>
+                    <%
+                       desc=message("property.#{property.key()}.description", :default => property.description())
+                       if desc.present? %>
+                      <p class="marginbottom10"><%= desc -%></p>
                     <% end %>
                     <p>
                       <% span_id = "text_" + property.key().gsub('.', '_') %>