org.gudy.azureus2.core3.internat
Class MessageText

java.lang.Object
  extended by org.gudy.azureus2.core3.internat.MessageText

public class MessageText
extends Object

Author:
Arbeiten, CrazyAlchemist Added keyExistsForDefaultLocale

Nested Class Summary
static interface MessageText.MessageTextListener
          Reverts Locale back to default, and removes the config settin.
 
Field Summary
static Locale LOCALE_DEFAULT
           
static Locale LOCALE_ENGLISH
           
 
Constructor Summary
MessageText()
           
 
Method Summary
static void addAndFireListener(MessageText.MessageTextListener listener)
           
static void addListener(MessageText.MessageTextListener listener)
           
static boolean changeLocale(Locale newLocale)
           
static String expandValue(String value)
           
static Locale getCurrentLocale()
           
static String getDefaultLocaleString(String key)
           
static Locale[] getLocales(boolean sort)
           
static String getPlatformNeutralString(String key)
           
static String getPlatformNeutralString(String key, String sDefault)
           
static String getString(String key)
           
static String getString(String key, String sDefault)
           
static String getString(String key, String[] params)
          Expands a message text and replaces occurrences of %1 with first param, %2 with second...
static String getStringForSentence(String sentence)
          Process a sequence of words, and translate the ones containing at least one '.', unless it's an ending dot.
static boolean integratePluginMessages(ResourceBundle bundle)
           
static boolean integratePluginMessages(String localizationPath, ClassLoader classLoader)
           
static boolean isCurrentLocale(Locale locale)
           
static boolean keyExists(String key)
           
static boolean keyExistsForDefaultLocale(String key)
           
static void loadBundle()
           
static void loadBundle(boolean forceReload)
           
static void removeListener(MessageText.MessageTextListener listener)
           
protected static String replaceStrings(String str, String f_s, String t_s)
           
static String resolveAcceleratorKey(String acceleratorKey)
          Sometime a accelerator key has 2 different returned values: one for Classic UI and another for the Vuze UI This method will attempt to locate the given key (with the prefix v3.
static String resolveLocalizationKey(String localizationKey)
          Sometime a localization key has 2 different returned values: one for Classic UI and another for the Vuze UI This method will attempt to locate the given key (with the prefix v3.
static void updateProductName()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOCALE_ENGLISH

public static final Locale LOCALE_ENGLISH

LOCALE_DEFAULT

public static final Locale LOCALE_DEFAULT
Constructor Detail

MessageText

public MessageText()
Method Detail

updateProductName

public static void updateProductName()

loadBundle

public static void loadBundle()

loadBundle

public static void loadBundle(boolean forceReload)

addListener

public static void addListener(MessageText.MessageTextListener listener)

addAndFireListener

public static void addAndFireListener(MessageText.MessageTextListener listener)

removeListener

public static void removeListener(MessageText.MessageTextListener listener)

keyExists

public static boolean keyExists(String key)

keyExistsForDefaultLocale

public static boolean keyExistsForDefaultLocale(String key)

getString

public static String getString(String key,
                               String sDefault)
Parameters:
key -
Returns:

getString

public static String getString(String key)

getPlatformNeutralString

public static String getPlatformNeutralString(String key)

getPlatformNeutralString

public static String getPlatformNeutralString(String key,
                                              String sDefault)

expandValue

public static String expandValue(String value)

getStringForSentence

public static String getStringForSentence(String sentence)
Process a sequence of words, and translate the ones containing at least one '.', unless it's an ending dot.

Parameters:
sentence -
Returns:
the formated String in the current Locale

getString

public static String getString(String key,
                               String[] params)
Expands a message text and replaces occurrences of %1 with first param, %2 with second...

Parameters:
key -
params -
Returns:

replaceStrings

protected static String replaceStrings(String str,
                                       String f_s,
                                       String t_s)

getDefaultLocaleString

public static String getDefaultLocaleString(String key)

getCurrentLocale

public static Locale getCurrentLocale()

isCurrentLocale

public static boolean isCurrentLocale(Locale locale)

getLocales

public static Locale[] getLocales(boolean sort)

changeLocale

public static boolean changeLocale(Locale newLocale)

integratePluginMessages

public static boolean integratePluginMessages(String localizationPath,
                                              ClassLoader classLoader)

integratePluginMessages

public static boolean integratePluginMessages(ResourceBundle bundle)

resolveLocalizationKey

public static String resolveLocalizationKey(String localizationKey)
Sometime a localization key has 2 different returned values: one for Classic UI and another for the Vuze UI This method will attempt to locate the given key (with the prefix v3. ) if applicable, if found then it will return the key with the prepended prefix. Otherwise it will return the key as given

Parameters:
localizationKey -
Returns:

resolveAcceleratorKey

public static String resolveAcceleratorKey(String acceleratorKey)
Sometime a accelerator key has 2 different returned values: one for Classic UI and another for the Vuze UI This method will attempt to locate the given key (with the prefix v3. ) if applicable, if found then it will return the key with the prepended prefix. Otherwise it will return the key as given

Parameters:
acceleratorKey -
Returns: