Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.crosswire.common.util
Class Languages

    java.lang.Object
      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:
  `The GNU Lesser General Public License for details.`

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)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Copyright ¨ 2003-2015
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD