tico.configuration
Class TLanguage

java.lang.Object
  extended by tico.configuration.TLanguage
Direct Known Subclasses:
TShowResults, TWriteLanguageFile

public class TLanguage
extends java.lang.Object

Static class that manages the application language files placed in the lang directory. All the language files must have the .lang extension and must be encoded in "UTF-8" charset.

Version:
1.0 Nov 20, 2006
Author:
Pablo Muñoz

Constructor Summary
TLanguage()
           
 
Method Summary
static java.util.Map getLanguages()
          Generates a map that contains all the language files of lang directory and its corresponding language names.
static java.lang.String getString(java.lang.String key)
          Returns the string of the specified key in the current language resource bundle.
static java.lang.String getString(java.lang.String language, java.lang.String key)
           
static void initLanguage(java.lang.String language)
          Inits the language file loading the file of the specified language to the LANGUAGE_BUNDLE.
static boolean languageExists(java.lang.String language)
          Determines if exists the language file.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TLanguage

public TLanguage()
Method Detail

initLanguage

public static void initLanguage(java.lang.String language)
                         throws java.io.IOException
Inits the language file loading the file of the specified language to the LANGUAGE_BUNDLE.

Parameters:
language - The current language
Throws:
java.io.IOException

languageExists

public static boolean languageExists(java.lang.String language)
Determines if exists the language file.

Parameters:
language - The language file to check
Returns:
true if the language file exists

getLanguages

public static java.util.Map getLanguages()
Generates a map that contains all the language files of lang directory and its corresponding language names.

Returns:
The generated map

getString

public static java.lang.String getString(java.lang.String key)
Returns the string of the specified key in the current language resource bundle.

Parameters:
key - The specified key
Returns:
The string of the specified key

getString

public static java.lang.String getString(java.lang.String language,
                                         java.lang.String key)