vooga.levelEditor.i18n
Class UIStrings

java.lang.Object
  extended by vooga.levelEditor.i18n.UIStrings

public class UIStrings
extends java.lang.Object

Provides an API for accessing the level editor's internationalization data. This data is stored in a set of properties files with the basename "strings".

Author:
Phil Puryear

Constructor Summary
UIStrings()
           
 
Method Summary
static java.util.ResourceBundle getBundle()
          Returns the underlying ResourceBundle used by this class.
static java.lang.String getString(java.lang.String key)
          Returns the localized string parameterized by the given identifier.
static void setLocale(java.util.Locale locale)
          Directs this class to use the properties file specified by the given locale.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UIStrings

public UIStrings()
Method Detail

getString

public static java.lang.String getString(java.lang.String key)
Returns the localized string parameterized by the given identifier.

Parameters:
key - The "key" string in a properties file.
Throws:
java.lang.RuntimeException - If setLocale has never been called.

getBundle

public static java.util.ResourceBundle getBundle()
Returns the underlying ResourceBundle used by this class. Consumers should not call this method unless they really need direct access to the underlying bundle.

See Also:
getString(String)

setLocale

public static void setLocale(java.util.Locale locale)
Directs this class to use the properties file specified by the given locale. For example, calling setLocale(Locale.ENGLISH) will prompt this class to start using the "strings_en" properties file.

Parameters:
locale - Any locale for which there is a corresponding properties file.