From 0054084c11dfb8565cc48b69f94a62a0f30c7576 Mon Sep 17 00:00:00 2001 From: simonbrandhof Date: Tue, 16 Aug 2011 22:43:26 +0200 Subject: [PATCH] SONAR-2716 Support localization of plugin properties --- .../resources/org/sonar/l10n/core.properties | 2 +- .../org/sonar/plugins/surefire/FooTest.java | 46 ------------------- .../app/views/settings/_plugins.html.erb | 12 +++-- 3 files changed, 8 insertions(+), 52 deletions(-) delete mode 100644 plugins/sonar-surefire-plugin/src/test/java/org/sonar/plugins/surefire/FooTest.java diff --git a/plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/core.properties b/plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/core.properties index 4d5541356c2..e4880af457b 100644 --- a/plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/core.properties +++ b/plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/core.properties @@ -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 index aae1f119a48..00000000000 --- a/plugins/sonar-surefire-plugin/src/test/java/org/sonar/plugins/surefire/FooTest.java +++ /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 diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_plugins.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_plugins.html.erb index 59e305d9573..b56c661fdf2 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_plugins.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_plugins.html.erb @@ -48,7 +48,7 @@ unless @properties_per_category[category].empty? %> - <%= link_to h(category), :overwrite_params => {:category => category} -%> + <%= link_to message("property.category.#{category}", :default => category), :overwrite_params => {:category => category} -%> <% end end @@ -60,7 +60,7 @@ <% 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 %> @@ -85,13 +85,15 @@

- <%= h(property.name()) -%> + <%= message("property.#{property.key()}.name", :default => property.name()) -%> <% if property.project() %>
<%= property.key() -%> <% end %>

- <% if property.description.present? %> -

<%= property.description -%>

+ <% + desc=message("property.#{property.key()}.description", :default => property.description()) + if desc.present? %> +

<%= desc -%>

<% end %>

<% span_id = "text_" + property.key().gsub('.', '_') %> -- 2.39.5