|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.enhydra.barracuda.plankton.l10n.Locales
org.enhydra.barracuda.core.util.l10n.Locales
Simple locale utilities. This class makes it easy to determine the target locale from an event context or a servlet request. You can also set the locale and ask the class to save the information for you (in a cookie and/or the session) so that the locale info will persist across muliple requests
Field Summary | |
protected static org.apache.log4j.Logger |
logger
|
Fields inherited from class org.enhydra.barracuda.plankton.l10n.Locales |
COOKIES_AND_SESSION, COUNTRY_KEY, LANGAUGE_KEY, NONE, PERSIST_DEFAULT, SESSION, VARIANT_KEY |
Constructor Summary | |
Locales()
|
Method Summary | |
static Locale |
getClientLocale(EventContext ec)
Get the client locale from an EventContext using the default param keys and persist option. |
static Locale |
getClientLocale(EventContext ec,
String languageKey,
String countryKey,
String variantKey,
int persistOption)
Get the client locale from an EventContext |
static void |
releaseClientLocale(EventContext ec)
Release the client locale using an EventContext (this effectively removes it from whereever it might have been persisted). |
static void |
releaseClientLocale(EventContext ec,
int persistOption)
Release the client locale using an EventContext (this effectively removes it from whereever it might have been persisted). |
static void |
saveClientLocale(EventContext ec,
Locale loc)
Save the client locale using an EventContext using the default persist option |
static void |
saveClientLocale(EventContext ec,
Locale loc,
int persistOption)
Save the client locale using an EventContext |
Methods inherited from class org.enhydra.barracuda.plankton.l10n.Locales |
findClosestLocale, getClientLocale, getClientLocale, releaseClientLocale, releaseClientLocale, saveClientLocale, saveClientLocale |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final org.apache.log4j.Logger logger
Constructor Detail |
public Locales()
Method Detail |
public static Locale getClientLocale(EventContext ec)
ec
- the EventContext from which we'd like to determine Locale
public static Locale getClientLocale(EventContext ec, String languageKey, String countryKey, String variantKey, int persistOption)
ec
- the EventContext from which we'd like to determine LocalelanguageKey
- the key to be used to look in the request for a
language paramtercountryKey
- the key to be used to look in the request for a
country paramtervariantKey
- the key to be used to look in the request for a
variant paramterpersistOption
- how we'd like to persist the Locale (by default, it will be stored
in the SESSION)
public static void saveClientLocale(EventContext ec, Locale loc)
ec
- the EventContext in which we'd like to set Localeloc
- the target client locale we'd like to setpublic static void saveClientLocale(EventContext ec, Locale loc, int persistOption)
ec
- the EventContext in which we'd like to set Localeloc
- the target client locale we'd like to setpersistOption
- the specific persistOption to be usedpublic static void releaseClientLocale(EventContext ec)
ec
- the EventContext in which we'd like to set Locale (this tells us
where the locale info needs to be removed from)public static void releaseClientLocale(EventContext ec, int persistOption)
ec
- the EventContext in which we'd like to set LocalepersistOption
- the specific persistOption to be used (this tells us
where the locale info needs to be removed from)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |