com.waveset.util
Class Locales

java.lang.Object
  extended bycom.waveset.util.Locales

public class Locales
extends java.lang.Object


Constructor Summary
Locales()
           
 
Method Summary
static java.util.List getCustomCatalogLocales()
          Return the Locales that have custom resource bundles as determined by CustomCatalog.
static java.util.List getWPMessagesLocales(java.util.List localeIds)
          Returns all of the Locales which have an exact matches for WPMessages.properties resource bundles.
static java.util.Map localeIdToDisplayName(java.util.Collection locales, java.util.Locale displayLocale)
          Return a map from locale ID (what's returned by Locales.localeToString) to the display name in the selected locale.
static java.lang.String localeToString(java.util.Locale locale)
          Returns a String representation of locale that can be passed to stringToLocale to retrieve the original locale.
static java.util.Locale parse(java.lang.String str)
          Parses a string created with Locale.toString
static java.util.Locale stringToLocale(java.lang.String localeId)
          Returns the locale with the given localeId, which must have been returned by a call to Util.localeToString.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Locales

public Locales()
Method Detail

parse

public static java.util.Locale parse(java.lang.String str)
Parses a string created with Locale.toString


localeToString

public static java.lang.String localeToString(java.util.Locale locale)
Returns a String representation of locale that can be passed to stringToLocale to retrieve the original locale.


stringToLocale

public static java.util.Locale stringToLocale(java.lang.String localeId)
Returns the locale with the given localeId, which must have been returned by a call to Util.localeToString.


getCustomCatalogLocales

public static final java.util.List getCustomCatalogLocales()
Return the Locales that have custom resource bundles as determined by CustomCatalog.


getWPMessagesLocales

public static java.util.List getWPMessagesLocales(java.util.List localeIds)
Returns all of the Locales which have an exact matches for WPMessages.properties resource bundles. If a Locale only partially matches (e.g. "en_US" does not exactly match "en"), then it is not included. Testing for locale presence is expensive, so we pass in the The method only tests locales


localeIdToDisplayName

public static java.util.Map localeIdToDisplayName(java.util.Collection locales,
                                                  java.util.Locale displayLocale)
Return a map from locale ID (what's returned by Locales.localeToString) to the display name in the selected locale.