| java.lang.Object org.apache.cocoon.i18n.I18nUtils
I18nUtils | public class I18nUtils (Code) | | A utility class for i18n formatting and parsing routing.
author: Konstantin Piroumian author: Vadim Gritsenko version: $Id: I18nUtils.java 474832 2006-11-14 15:56:43Z vgritsenko $ |
Inner Class :public interface LocaleValidator | |
Field Summary | |
final public static String | NAMESPACE_URI The namespace for i18n is "http://apache.org/cocoon/i18n/2.1". | final public static String | OLD_NAMESPACE_URI The old namespace for i18n is "http://apache.org/cocoon/i18n/2.0". |
Method Summary | |
public static Locale | findLocale(Map objectModel, String attribute, Parameters parameters, Locale defaultLocale, boolean useLocale, boolean useLocales, boolean useBlankLocale, LocaleValidator test) Find a suitable locale from an objectModel. | public static Locale | findLocale(Map objectModel, String attribute, Parameters parameters, Locale defaultLocale, boolean useLocale) Find a suitable locale from an objectModel. | public static boolean | matchesI18nNamespace(String uri) | public static Locale | parseLocale(String localeString, Locale defaultLocale) Parses given locale string to Locale object. | public static Locale | parseLocale(String localeString) Parses given locale string to Locale object. | public static void | storeLocale(Map objectModel, String attribute, String locale, boolean storeInRequest, boolean storeInSession, boolean storeInCookie, boolean createSession) Store locale in request, session, or cookie. |
NAMESPACE_URI | final public static String NAMESPACE_URI(Code) | | The namespace for i18n is "http://apache.org/cocoon/i18n/2.1".
|
OLD_NAMESPACE_URI | final public static String OLD_NAMESPACE_URI(Code) | | The old namespace for i18n is "http://apache.org/cocoon/i18n/2.0".
|
findLocale | public static Locale findLocale(Map objectModel, String attribute, Parameters parameters, Locale defaultLocale, boolean useLocale, boolean useLocales, boolean useBlankLocale, LocaleValidator test)(Code) | | Find a suitable locale from an objectModel.
since: 2.1.6 locale found, or null if none found. |
findLocale | public static Locale findLocale(Map objectModel, String attribute, Parameters parameters, Locale defaultLocale, boolean useLocale)(Code) | | Find a suitable locale from an objectModel.
since: 2.1.6 locale found, or server default (never null). |
matchesI18nNamespace | public static boolean matchesI18nNamespace(String uri)(Code) | | |
parseLocale | public static Locale parseLocale(String localeString, Locale defaultLocale)(Code) | | Parses given locale string to Locale object. If the string is null
or empty then the given locale is returned.
Parameters: localeString - - a string containing locale inlanguage_country_variant format. Parameters: defaultLocale - - returned if localeString is null or "" |
storeLocale | public static void storeLocale(Map objectModel, String attribute, String locale, boolean storeInRequest, boolean storeInSession, boolean storeInCookie, boolean createSession)(Code) | | Store locale in request, session, or cookie.
since: 2.1.6 |
|
|