|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectfr.paris.lutece.portal.service.i18n.I18nService
public final class I18nService
This class provides services for internationalization (i18n)
| Method Summary | |
|---|---|
static java.util.List<java.util.Locale> |
getAdminAvailableLocales()
Returns supported locales for Lutece backoffice |
static ReferenceList |
getAdminLocales(java.util.Locale locale)
Returns a ReferenceList of available locales |
static java.lang.String |
getDateFormatShortPattern(java.util.Locale locale)
Get the short date format specified by a locale |
static java.util.Locale |
getDefaultLocale()
Get the default Locale specified in properties file |
static java.lang.String |
getLocalizedDate(java.util.Date date,
java.util.Locale locale,
int nDateFormat)
Format a date according to the given locale |
static java.lang.String |
getLocalizedDateTime(java.util.Date date,
java.util.Locale locale,
int nDateFormat,
int nTimeFormat)
Format a date according to the given locale |
static java.lang.String |
getLocalizedString(java.lang.String strKey,
java.util.Locale theLocale)
Returns the string corresponding to a given key for a given locale Core key structure : portal. |
static java.lang.String |
getLocalizedString(java.lang.String strKey,
java.lang.Object[] arguments,
java.util.Locale locale)
Returns the string corresponding to a given key for a given locale that use a MessageFormat pattern with arguments. |
static java.lang.String |
localize(java.lang.String strSource,
java.util.Locale locale)
This method localize a string. |
static java.util.Collection |
localizeCollection(java.util.Collection<? extends Localizable> collection,
java.util.Locale locale)
Localize all items of a list |
static java.util.List |
localizeCollection(java.util.List<? extends Localizable> list,
java.util.Locale locale)
Localize all items of a list |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static java.lang.String localize(java.lang.String strSource,
java.util.Locale locale)
strSource - The string that contains localization keyslocale - The locale
public static java.lang.String getLocalizedString(java.lang.String strKey,
java.util.Locale theLocale)
portal.[admin, features, insert, rbac, search, site, style, system, users, util].key[plugin].key module.[plugin].[module].key
strKey - The key of the stringtheLocale - The locale
public static java.lang.String getLocalizedString(java.lang.String strKey,
java.lang.Object[] arguments,
java.util.Locale locale)
arguments - The arguments used as values by the formatterstrKey - The key of the string that contains the patternlocale - The locale
public static java.lang.String getLocalizedDate(java.util.Date date,
java.util.Locale locale,
int nDateFormat)
date - The date to formatlocale - The localenDateFormat - A DateFormat constant corresponding to the expected format. (ie: DateFormat.FULL)
public static java.lang.String getLocalizedDateTime(java.util.Date date,
java.util.Locale locale,
int nDateFormat,
int nTimeFormat)
date - The date to formatlocale - The localenDateFormat - A DateFormat constant corresponding to the expected format. (ie: DateFormat.FULL)nTimeFormat - A TimeFormat constant corresponding to the expected format. (ie: DateFormat.SHORT)
public static java.util.List<java.util.Locale> getAdminAvailableLocales()
public static java.util.Locale getDefaultLocale()
public static java.lang.String getDateFormatShortPattern(java.util.Locale locale)
public static ReferenceList getAdminLocales(java.util.Locale locale)
locale - The locale to display available languages
public static java.util.Collection localizeCollection(java.util.Collection<? extends Localizable> collection,
java.util.Locale locale)
collection - The list to localizelocale - The locale
public static java.util.List localizeCollection(java.util.List<? extends Localizable> list,
java.util.Locale locale)
list - The list to localizelocale - The locale
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||