public class LocaleUtils
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
(package private) static java.lang.String |
PROP_LOCALE
The token representing the locale property controlling Localization.
|
(package private) static java.lang.String |
PROP_LOCALE_COOKIE
The config property identifying the cookie name to possibly get the value
of the locale property.
|
(package private) static java.lang.String |
PROP_LOCALE_QUERY_PARAM
The config property identifying the URL query parameter name to possibly get
the value of the locale property.
|
(package private) static java.lang.String |
PROP_RUNTIME_LOCALES
The token representing the runtime.locales configuration property.
|
Modifier and Type | Method and Description |
---|---|
java.util.Set<GwtLocale> |
getAllCompileLocales()
Returns the set of all compile-time locales.
|
java.util.Set<GwtLocale> |
getAllLocales()
Returns the set of all available locales, whether compile-time locales or
runtime locales.
|
GwtLocale |
getCompileLocale()
Returns the static compile-time locale for this permutation.
|
java.lang.String |
getCookie()
Return the name of the cookie to potentially get the locale value from.
|
static LocaleUtils |
getInstance(TreeLogger logger,
PropertyOracle propertyOracle,
GeneratorContext context)
Create a new LocaleUtils instance for the given PropertyOracle.
|
static GwtLocaleFactory |
getLocaleFactory()
Get a shared GwtLocale factory so instances are cached between all uses.
|
java.lang.String |
getQueryParam()
Return the name of the URL query param to potentially get the locale value
from.
|
java.util.Set<GwtLocale> |
getRuntimeLocales()
Returns a list of locales which are children of the current compile-time
locale.
|
static final java.lang.String PROP_LOCALE
static final java.lang.String PROP_LOCALE_QUERY_PARAM
static final java.lang.String PROP_LOCALE_COOKIE
static final java.lang.String PROP_RUNTIME_LOCALES
public static LocaleUtils getInstance(TreeLogger logger, PropertyOracle propertyOracle, GeneratorContext context)
logger
- propertyOracle
- public static GwtLocaleFactory getLocaleFactory()
public java.util.Set<GwtLocale> getAllCompileLocales()
public java.util.Set<GwtLocale> getAllLocales()
public GwtLocale getCompileLocale()
public java.lang.String getCookie()
public java.lang.String getQueryParam()
public java.util.Set<GwtLocale> getRuntimeLocales()