public class I18nManagerImpl extends Object implements I18nManager
ENGLISH, SPANISH
Constructor and Description |
---|
I18nManagerImpl() |
Modifier and Type | Method and Description |
---|---|
static String |
capitalize(String text) |
void |
exportLocaleForTranslation(Locale locale,
Locale[] referenceLocales,
File exportFile)
Exports the keys of text to translate to a new locale to a jar file.
|
void |
exportLocaleForTranslation(Locale locale,
Locale referenceLocale,
File exportFile)
Exports the keys of text to translate to a new locale to a jar file.
|
void |
exportLocaleForUpdate(Locale locale,
Locale referenceLocale,
File exportFile)
Exports the translations of a locale to update or complete its
translation, into a jar file.
|
void |
exportLocalesForUpdate(Locale[] locales,
Locale referenceLocale,
File exportFile)
Exports the translations of a list of locales to update or complete its
translation, into a jar file.
|
Locale |
getCurrentLocale()
Returns the current locale.
|
Locale |
getDefaultSystemLocale()
Returns the application host system default locale.
|
String |
getDisplayName(Locale locale)
Returns the display name of a locale.
|
String |
getDisplayName(Locale locale,
Locale displayLocale)
Returns the display name of a locale in the given locale to be displayed.
|
Locale[] |
getInstalledLocales()
Returns the list of locales supported by the current gvSIG installation.
|
static I18nManager |
getInstance()
Returns the unique instance of the I18nManager.
|
String |
getLanguageDisplayName(Locale locale)
Returns the display name of a locale language.
|
String |
getLanguageDisplayName(Locale locale,
Locale displayLocale)
Returns the display name of a locale language.
|
Locale[] |
getReferenceLocales()
Returns the list of default locales to use as reference when exporting to
translate a new locale, or update or complete an existing one.
|
void |
installLocale(Locale locale)
Install a new locale in the framework of andami.
|
Locale[] |
installLocales(File importFile)
Installs or a new locale (or a list) and its translation, or updates an
already existing one.
|
void |
setCurrentLocale(Locale locale)
Sets the current application locale.
|
void |
setDefaultLocales(Locale[] defaultLocales)
Sets the list of default locales bundled with gvSIG.
|
void |
setReferenceLocales(Locale[] referenceLocales)
Sets the list of default locales to export.
|
void |
uninstallLocale(Locale locale)
Uninstalls a locale and its translation.
|
public static I18nManager getInstance()
public Locale getCurrentLocale()
I18nManager
getCurrentLocale
in interface I18nManager
public Locale[] getInstalledLocales()
I18nManager
getInstalledLocales
in interface I18nManager
public void setCurrentLocale(Locale locale)
I18nManager
setCurrentLocale
in interface I18nManager
locale
- the current application localepublic Locale getDefaultSystemLocale()
I18nManager
getDefaultSystemLocale
in interface I18nManager
public void installLocale(Locale locale)
I18nManager
installLocale
in interface I18nManager
locale
- to installpublic void uninstallLocale(Locale locale) throws I18nException
I18nManager
uninstallLocale
in interface I18nManager
locale
- to uninstallI18nException
- if the locale can't be uninstalledpublic String getDisplayName(Locale locale)
I18nManager
getDisplayName
in interface I18nManager
locale
- to get the display namepublic String getDisplayName(Locale locale, Locale displayLocale)
I18nManager
getDisplayName
in interface I18nManager
locale
- to get the display namedisplayLocale
- the locale to display the namepublic String getLanguageDisplayName(Locale locale)
I18nManager
getLanguageDisplayName
in interface I18nManager
locale
- to get the language display namepublic String getLanguageDisplayName(Locale locale, Locale displayLocale)
I18nManager
getLanguageDisplayName
in interface I18nManager
locale
- to get the language display namedisplayLocale
- the locale to display the namepublic Locale[] installLocales(File importFile) throws I18nException
I18nManager
installLocales
in interface I18nManager
importFile
- the jar or zip file which contains the locales and the
translations as resource bundle filesI18nException
- if the locales could'n be installedpublic void exportLocaleForUpdate(Locale locale, Locale referenceLocale, File exportFile) throws I18nException
I18nManager
exportLocaleForUpdate
in interface I18nManager
locale
- the locale to update or completereferenceLocale
- the locale to be used as referenceexportFile
- the jar file to export toI18nException
- if the locale could not be exported for updatepublic void exportLocalesForUpdate(Locale[] locales, Locale referenceLocale, File exportFile) throws I18nException
I18nManager
exportLocalesForUpdate
in interface I18nManager
locales
- the locales to update or completereferenceLocale
- the locale to be used as referenceexportFile
- the jar file to export toI18nException
- if the locale could not be exported for updatepublic void exportLocaleForTranslation(Locale locale, Locale referenceLocale, File exportFile) throws I18nException
I18nManager
exportLocaleForTranslation
in interface I18nManager
locale
- the new locale to translate toreferenceLocale
- the locale to be used as referenceexportFile
- the jar file to export toI18nException
- if the locale could not be exported for translationpublic void exportLocaleForTranslation(Locale locale, Locale[] referenceLocales, File exportFile) throws I18nException
I18nManager
exportLocaleForTranslation
in interface I18nManager
locale
- the new locale to translate toreferenceLocales
- the locales to be used as referenceexportFile
- the jar file to export toI18nException
- if the locale could not be exported for translationpublic Locale[] getReferenceLocales()
I18nManager
getReferenceLocales
in interface I18nManager
public void setReferenceLocales(Locale[] referenceLocales)
I18nManager
setReferenceLocales
in interface I18nManager
referenceLocales
- the list of default locales to exportpublic void setDefaultLocales(Locale[] defaultLocales)
I18nManager
setDefaultLocales
in interface I18nManager