aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api
diff options
context:
space:
mode:
authorsimonbrandhof <simon.brandhof@gmail.com>2011-07-25 20:32:05 +0200
committersimonbrandhof <simon.brandhof@gmail.com>2011-07-25 21:53:57 +0200
commit3380cba1de57f48e535de91e0c98c16030a36fa8 (patch)
treed3d82e78ae20b7508771e22eb5a475c1e2dea3e0 /sonar-plugin-api
parente7675ba5c8c7d6bb7550fba092dfb1a9abd3ec5c (diff)
downloadsonarqube-3380cba1de57f48e535de91e0c98c16030a36fa8.tar.gz
sonarqube-3380cba1de57f48e535de91e0c98c16030a36fa8.zip
SONAR-75 define locale for violation messages
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/CoreProperties.java2
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/i18n/I18n.java33
2 files changed, 12 insertions, 23 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/CoreProperties.java b/sonar-plugin-api/src/main/java/org/sonar/api/CoreProperties.java
index 60394906afa..8760081c433 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/CoreProperties.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/CoreProperties.java
@@ -81,6 +81,8 @@ public interface CoreProperties {
/* Sonar Core */
String CORE_PLUGIN = "core";
+ String CORE_VIOLATION_LOCALE_PROPERTY = "sonar.violationLocale";
+ String CORE_VIOLATION_LOCALE_DEFAULT_VALUE = "en";
String CORE_COVERAGE_PLUGIN_PROPERTY = "sonar.core.codeCoveragePlugin";
String CORE_IMPORT_SOURCES_PROPERTY = "sonar.importSources";
boolean CORE_IMPORT_SOURCES_DEFAULT_VALUE = true;
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/i18n/I18n.java b/sonar-plugin-api/src/main/java/org/sonar/api/i18n/I18n.java
index cef7a86fe11..6e25699c0ac 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/i18n/I18n.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/i18n/I18n.java
@@ -19,42 +19,29 @@
*/
package org.sonar.api.i18n;
-import org.sonar.api.BatchComponent;
import org.sonar.api.ServerComponent;
import java.util.Locale;
/**
- *
- *
- *
- * EXPERIMENTAL - this feature will be fully implemented in version 2.10
- *
- *
- *
- * The <code>I18n</code> Interface is the entry point for the internationalization of the Sonar application and plugins.<br>The corresponding implementation is located in the core plugin.
- * <p/>
- * I18n is managed in Sonar through the use of key-based resource bundles.
- * <br>
- * Though any key can be used, the following key-naming conventions, which are applied in the Sonar application and core plugins, are given as guidelines:
- *
- * @since 2.9
+ * @since 2.10
*/
-public interface I18n extends ServerComponent, BatchComponent {
+public interface I18n extends ServerComponent {
/**
* Searches the message of the <code>key</code> for the <code>locale</code> in the list of available bundles.
* <br>
* If not found in any bundle, <code>defaultText</code> is returned.
- *
- * If additional parameters are given (in the objects list), the result is used as a message pattern
- * to use in a MessageFormat object along with the given parameters.
+ * <p/>
+ * If additional parameters are given (in the objects list), the result is used as a message pattern
+ * to use in a MessageFormat object along with the given parameters.
*
- * @param locale the locale to translate into
- * @param key the key of the pattern to translate
+ * @param locale the locale to translate into
+ * @param key the key of the pattern to translate
* @param defaultValue the default pattern returned when the key is not found in any bundle
- * @param parameters the parameters used to format the message from the translated pattern.
- * @return the message formatted with the translated pattern and the given parameters
+ * @param parameters the parameters used to format the message from the translated pattern.
+ * @return the message formatted with the translated pattern and the given parameters
*/
public abstract String message(final Locale locale, final String key, final String defaultValue, final Object... parameters);
+
}