org.crosswire.bibledesktop.desktop
Class Translations

java.lang.Object
  extended by org.crosswire.bibledesktop.desktop.Translations

public class Translations
extends Object

Translations provides a list of languages that BibleDesktop has been translated into.

Author:
DM Smith [dmsmith555 at yahoo dot com]
See Also:
for license details. The copyright to this program is held by it's authors.

Field Summary
static String DEFAULT_TRANSLATION
          The default translation, if the user has not chosen anything else.
private static Translations instance
           
private static Logger log
          The log stream
private  String translation
          The language that BibleDesktop should use.
private static String TRANSLATION_KEY
          The key used in config.xml
private  String[] translations
          List of available languages.
 
Constructor Summary
private Translations()
          Singleton classes have private constructors.
 
Method Summary
 String getCurrent()
          Get the current translation as a human readable string.
 Locale getCurrentLocale()
          Get the locale for the current translation.
static String getCurrentTranslation()
          Get the current translation as a human readable string.
 String[] getSupported()
          Gets a listing of all the translations that Bible Desktop supports.
static String[] getSupportedTranslations()
          Gets a listing of all the translations that Bible Desktop supports.
static Translations instance()
          All access to Translations is through this single instance.
 void register()
          Register this class with the common config engine.
 void setCurrent(String newTranslation)
          Set the current translation, using human readable string.
static void setCurrentTranslation(String newTranslation)
          Set the current translation, using human readable string.
 void setLocale()
          Set the locale for the program to the one the user has selected.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TRANSLATION_KEY

private static final String TRANSLATION_KEY
The key used in config.xml

See Also:
Constant Field Values

DEFAULT_TRANSLATION

public static final String DEFAULT_TRANSLATION
The default translation, if the user has not chosen anything else.

See Also:
Constant Field Values

translation

private String translation
The language that BibleDesktop should use.


translations

private String[] translations
List of available languages.


instance

private static Translations instance

log

private static final Logger log
The log stream

Constructor Detail

Translations

private Translations()
Singleton classes have private constructors.

Method Detail

instance

public static Translations instance()
All access to Translations is through this single instance.

Returns:
the singleton instance

getSupported

public String[] getSupported()
Gets a listing of all the translations that Bible Desktop supports.

Returns:
an string array of translations in locale friendly names.

getCurrentLocale

public Locale getCurrentLocale()
Get the locale for the current translation.

Returns:
the translation's locale

getCurrent

public String getCurrent()
Get the current translation as a human readable string.

Returns:
the current translation

setCurrent

public void setCurrent(String newTranslation)
Set the current translation, using human readable string.

Parameters:
translation - the translation to use

setLocale

public void setLocale()
Set the locale for the program to the one the user has selected. But don't set it to the default translation, so that the user's actual locale, is used for Bible book names. This only makes sense after config has called setCurrentTranslation.


register

public void register()
Register this class with the common config engine.


getCurrentTranslation

public static String getCurrentTranslation()
Get the current translation as a human readable string.

Returns:
the current translation

setCurrentTranslation

public static void setCurrentTranslation(String newTranslation)
Set the current translation, using human readable string.

Parameters:
translation - the translation to use

getSupportedTranslations

public static String[] getSupportedTranslations()
Gets a listing of all the translations that Bible Desktop supports.

Returns:
an string array of translations in locale friendly names.

Copyright ยจ 2003-2007