com.google.gwt.i18n.client
Class LocaleInfo

java.lang.Object
  extended by com.google.gwt.i18n.client.LocaleInfo

public class LocaleInfo
extends java.lang.Object

Provides access to the currently-active locale and the list of available locales.


Constructor Summary
protected LocaleInfo()
          Constructor to be used by subclasses, such as mock classes for testing.
 
Method Summary
static java.lang.String[] getAvailableLocaleNames()
           
static LocaleInfo getCurrentLocale()
           
 com.google.gwt.i18n.client.constants.DateTimeConstants getDateTimeConstants()
          Return a DateTimeConstants interface suitable for this locale.
 java.lang.String getLocaleName()
           
static java.lang.String getLocaleNativeDisplayName(java.lang.String localeName)
          Return the display name of the requested locale in its native locale, if possible.
 com.google.gwt.i18n.client.constants.NumberConstants getNumberConstants()
          Return a NumberConstants interface suitable for this locale.
 boolean isRTL()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocaleInfo

protected LocaleInfo()
Constructor to be used by subclasses, such as mock classes for testing. Any such subclass should override all methods.

Method Detail

getAvailableLocaleNames

public static java.lang.String[] getAvailableLocaleNames()
Returns:
an array of available locale names

getCurrentLocale

public static LocaleInfo getCurrentLocale()
Returns:
a LocaleInfo instance for the current locale

getLocaleNativeDisplayName

public static java.lang.String getLocaleNativeDisplayName(java.lang.String localeName)
Return the display name of the requested locale in its native locale, if possible. If no native localization is available, the English name will be returned, or as a last resort just the locale name will be returned. If the locale name is unknown (including an user overrides) or is not a valid locale property value, null is returned. If the I18N module has not been imported, this will always return null.

Parameters:
localeName - the name of the locale to lookup.
Returns:
the name of the locale in its native locale

getDateTimeConstants

public final com.google.gwt.i18n.client.constants.DateTimeConstants getDateTimeConstants()
Return a DateTimeConstants interface suitable for this locale.


getLocaleName

public java.lang.String getLocaleName()
Returns:
the name of this locale, such as "default, "en_US", etc

getNumberConstants

public final com.google.gwt.i18n.client.constants.NumberConstants getNumberConstants()
Return a NumberConstants interface suitable for this locale.


isRTL

public boolean isRTL()
Returns:
true if this locale is right-to-left instead of left-to-right