com.arsdigita.cms.util
Class LanguageUtil

java.lang.Object
  extended bycom.arsdigita.cms.util.LanguageUtil

public class LanguageUtil
extends Object

Utility methods for dealing with the multilingual items.

Author:
Shashin Shinde (sshinde@redhat.com)

Constructor Summary
LanguageUtil()
           
 
Method Summary
static Collection convertTo3LA(Collection list)
          Takes in a list of 2 letter codes and converts into 3 letter codes.
static Collection convertToFull(Collection list)
           
static Collection convertToG11N(Collection list)
           
static Collection getCreatableLanguages(ContentPage item)
          Get the List of languages in which this item can be created.
static String getLang3LA(String lang)
          Returns three letter acronym for language code mapped from two letter code.
static String getLangFull(String lang)
          Returns the full language name mapped from the two letter acronym.
static String getSupportedLanguages()
          Get the comma separated list of all supported languages
static Collection getSupportedLanguages2LA()
          Returns the collection of all supported languages.
static Collection getSupportedLanguages3LA()
          Returns the collection of all supported languages.
static Collection getSupportedLanguagesFull()
          Returns the collection of all supported languages.
static com.arsdigita.globalization.GlobalizedMessage globalize(String key)
           
static void setSupportedLanguages(String languages)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LanguageUtil

public LanguageUtil()
Method Detail

globalize

public static com.arsdigita.globalization.GlobalizedMessage globalize(String key)

setSupportedLanguages

public static void setSupportedLanguages(String languages)

getSupportedLanguages

public static String getSupportedLanguages()
Get the comma separated list of all supported languages


getSupportedLanguages2LA

public static Collection getSupportedLanguages2LA()
Returns the collection of all supported languages.

Returns:
all supported languages

getSupportedLanguages3LA

public static Collection getSupportedLanguages3LA()
Returns the collection of all supported languages. Each entry is a pair of 2 letter code as key and three letter code as value.

Returns:
all supported languages

getSupportedLanguagesFull

public static Collection getSupportedLanguagesFull()
Returns the collection of all supported languages. Each entry is a pair of 2 letter code as key and full language name as a value.

Returns:
all supported languages

getCreatableLanguages

public static Collection getCreatableLanguages(ContentPage item)
Get the List of languages in which this item can be created. Usefull on UI where we need to display the list of languages in which this Item can be created.


getLang3LA

public static String getLang3LA(String lang)
Returns three letter acronym for language code mapped from two letter code.

Returns:
three letter code for the two letter code. If the resource is not found then the key itself is returned.

getLangFull

public static String getLangFull(String lang)
Returns the full language name mapped from the two letter acronym.

Parameters:
lang - 2 letter language code
Returns:
full language name for the given two letter code If the resource is not found then the key itself is returned.

convertTo3LA

public static Collection convertTo3LA(Collection list)
Takes in a list of 2 letter codes and converts into 3 letter codes. Each entry is pair of 2 letter code as key and 3 letter code as value.


convertToFull

public static Collection convertToFull(Collection list)

convertToG11N

public static Collection convertToG11N(Collection list)


Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 19 2004:2352 UTC