org.crosswire.common.util
Class Languages

java.lang.Object
  extended by org.crosswire.common.util.Languages

public final class Languages
extends Object

A utility class that converts bcp-47 codes as supported by Language to their localized language name.

Author:
DM Smith
See Also:
for license details.
The copyright to this program is held by it's authors.

Nested Class Summary
static class Languages.AllLanguages
          Provide a fallback lookup against a huge list of all languages.
static class Languages.RtoL
          Provide a fallback lookup against a huge list of all languages.
 
Field Summary
private static Map<Locale,ResourceBundle> localisedCommonLanguages
           
protected static org.slf4j.Logger log
          The log stream
 
Constructor Summary
private Languages()
          Make the class a true utility class by having a private constructor.
 
Method Summary
private static ResourceBundle getLocalisedCommonLanguages()
          Gets the localised common languages.
static String getName(String code)
          Get the language name for the BCP-47 specification of the language.
private static ResourceBundle initLanguages(Locale locale)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

localisedCommonLanguages

private static Map<Locale,ResourceBundle> localisedCommonLanguages

log

protected static final org.slf4j.Logger log
The log stream

Constructor Detail

Languages

private Languages()
Make the class a true utility class by having a private constructor.

Method Detail

getName

public static String getName(String code)
Get the language name for the BCP-47 specification of the language.

Parameters:
code - the BCP-47 specification for the language
Returns:
the name of the language

getLocalisedCommonLanguages

private static ResourceBundle getLocalisedCommonLanguages()
Gets the localised common languages. Caching here, is done to prevent extra logging happening every time we miss the iso639 ResourceBundle and end up having to lookup the iso639full

Returns:
the localised common languages

initLanguages

private static ResourceBundle initLanguages(Locale locale)

Copyright ? 2003-2011