gr.bluevibe.fire.util
Class Lang

java.lang.Object
  extended bygr.bluevibe.fire.util.Lang

public final class Lang
extends java.lang.Object

The Lang class in an easy to use internationallization (i18n) implementation. The default language is English. Every key is the english version of the required text. If the key string maps to to a translation then the translation is returned. Othewise the key itself is returned. The class can load files with "key=value" pairs of strings on each line. The bundles can be loaded (using the FireIO class) either from a file inside the jar, or from a remote location or from a record in the midlets record store.

Author:
padeler

Field Summary
static java.lang.String defaultLang
           
 
Method Summary
static java.lang.String get(java.lang.String key)
          Returns the string translation that maps to the key, or the key itself if the translation was not found.
static java.lang.String getLang()
          Returns a string indicating the current language.
static void loadBundle()
          Loads the stored bundle.
static void setBundle(java.lang.String lang, java.lang.String resource)
          Sets a resource bundle.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

defaultLang

public static final java.lang.String defaultLang
See Also:
Constant Field Values
Method Detail

getLang

public static java.lang.String getLang()
Returns a string indicating the current language.

Returns:

setBundle

public static void setBundle(java.lang.String lang,
                             java.lang.String resource)
                      throws java.lang.Exception
Sets a resource bundle.

Parameters:
lang - The string naming the language of the bundle
resource - The resource string.
Throws:
java.lang.Exception

loadBundle

public static void loadBundle()
Loads the stored bundle.


get

public static java.lang.String get(java.lang.String key)
Returns the string translation that maps to the key, or the key itself if the translation was not found.

Parameters:
key -
Returns:
A translation of key