public class I18nUtil
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.util.Locale |
DEFAULTLOCALE |
| Constructor and Description |
|---|
I18nUtil() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
getDefaultLicense(Context context)
Get the appropriate localized version of the default.license according to language settings
|
static java.util.Locale |
getDefaultLocale()
Gets the default locale as defined in dspace.cfg If no default locale is
defined, the Locale of the JVM is used
|
static java.lang.String |
getEmailFilename(java.util.Locale locale,
java.lang.String name)
Get the appropriate localized version of an email template according to language settings
|
static java.util.Locale |
getEPersonLocale(EPerson ep)
Get the Locale for a specified EPerson.
|
static java.lang.String |
getInputFormsFileName(java.util.Locale locale)
Get the appropriate localized version of input-forms.xml according to language settings
|
static java.lang.String |
getMessage(java.lang.String key)
et the i18n message string for a given key and use the default Locale
|
static java.lang.String |
getMessage(java.lang.String key,
Context c)
Get the i18n message string for a given key and context
|
static java.lang.String |
getMessage(java.lang.String key,
java.util.Locale locale)
Get the i18n message string for a given key and locale
|
static java.util.Locale |
getSupportedLocale(java.util.Locale locale)
Gets the appropriate supported Locale according for a given Locale If
no appropriate supported locale is found, the DEFAULTLOCALE is used
|
static java.util.Locale[] |
getSupportedLocales()
get the available Locales for the User Interface as defined in dspace.cfg
returns an array of Locales or null
|
static java.util.Locale[] |
parseLocales(java.lang.String ll)
Creates array of Locales from text list of locale-specifications.
|
public static java.util.Locale getDefaultLocale()
public static java.util.Locale getEPersonLocale(EPerson ep)
ep - public static java.util.Locale[] getSupportedLocales()
public static java.util.Locale getSupportedLocale(java.util.Locale locale)
locale - Locale to find the corresponding Localepublic static java.lang.String getInputFormsFileName(java.util.Locale locale)
locale - Locale, the local to get the input-forms.xml forpublic static java.lang.String getMessage(java.lang.String key)
throws java.util.MissingResourceException
key - String - name of the key to get the message forjava.util.MissingResourceExceptionpublic static java.lang.String getMessage(java.lang.String key,
java.util.Locale locale)
throws java.util.MissingResourceException
key - String - name of the key to get the message forlocale - Locale, to get the message forjava.util.MissingResourceExceptionpublic static java.lang.String getMessage(java.lang.String key,
Context c)
throws java.util.MissingResourceException
key - String - name of the key to get the message forc - Context having the desired Localejava.util.MissingResourceExceptionpublic static java.lang.String getDefaultLicense(Context context)
context - the current DSpace contextpublic static java.lang.String getEmailFilename(java.util.Locale locale,
java.lang.String name)
locale - Locale for this requestname - String - base name of the email templatepublic static java.util.Locale[] parseLocales(java.lang.String ll)
ll - locale list of comma-separated valuesCopyright © 2018 DuraSpace. All Rights Reserved.