org.sonar.core.i18n
Class I18nManager

java.lang.Object
  extended by org.sonar.core.i18n.I18nManager
All Implemented Interfaces:
Extension, I18n, ServerComponent, ServerExtension

public class I18nManager
extends Object
implements I18n, ServerExtension


Field Summary
static String BUNDLE_PACKAGE
           
static String ENGLISH_PACK_PLUGIN_KEY
           
 
Constructor Summary
I18nManager(PluginRepository pluginRepository)
           
 
Method Summary
 String message(Locale locale, String key, String defaultValue, Object... parameters)
          Searches the message of the key for the locale in the list of available bundles.
 void start()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ENGLISH_PACK_PLUGIN_KEY

public static final String ENGLISH_PACK_PLUGIN_KEY
See Also:
Constant Field Values

BUNDLE_PACKAGE

public static final String BUNDLE_PACKAGE
See Also:
Constant Field Values
Constructor Detail

I18nManager

public I18nManager(PluginRepository pluginRepository)
Method Detail

start

public void start()

message

public String message(Locale locale,
                      String key,
                      String defaultValue,
                      Object... parameters)
Description copied from interface: I18n
Searches the message of the key for the locale in the list of available bundles.
If not found in any bundle, defaultText 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.

Specified by:
message in interface I18n
Parameters:
locale - the locale to translate into
key - the key of the pattern to translate
defaultValue - the default pattern returned when the key is not found in any bundle
parameters - the parameters used to format the message from the translated pattern.
Returns:
the message formatted with the translated pattern and the given parameters


Copyright © 2009-2012 SonarSource. All Rights Reserved.