public class I18nManagerImpl extends java.lang.Object implements I18nManager
ENGLISH, SPANISH
Constructor and Description |
---|
I18nManagerImpl() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
capitalize(java.lang.String text) |
void |
exportLocaleForTranslation(java.util.Locale locale,
java.util.Locale[] referenceLocales,
java.io.File exportFile)
Exports the keys of text to translate to a new locale to a jar file.
|
void |
exportLocaleForTranslation(java.util.Locale locale,
java.util.Locale referenceLocale,
java.io.File exportFile)
Exports the keys of text to translate to a new locale to a jar file.
|
void |
exportLocaleForUpdate(java.util.Locale locale,
java.util.Locale referenceLocale,
java.io.File exportFile)
Exports the translations of a locale to update or complete its
translation, into a jar file.
|
void |
exportLocalesForUpdate(java.util.Locale[] locales,
java.util.Locale referenceLocale,
java.io.File exportFile)
Exports the translations of a list of locales to update or complete its
translation, into a jar file.
|
java.util.Locale |
getCurrentLocale()
Returns the current locale.
|
java.util.Locale |
getDefaultSystemLocale()
Returns the application host system default locale.
|
java.lang.String |
getDisplayName(java.util.Locale locale)
Returns the display name of a locale.
|
java.lang.String |
getDisplayName(java.util.Locale locale,
java.util.Locale displayLocale)
Returns the display name of a locale in the given locale to be displayed.
|
java.util.Locale[] |
getInstalledLocales()
Returns the list of locales supported by the current gvSIG installation.
|
static I18nManager |
getInstance()
Returns the unique instance of the I18nManager.
|
java.lang.String |
getLanguageDisplayName(java.util.Locale locale)
Returns the display name of a locale language.
|
java.lang.String |
getLanguageDisplayName(java.util.Locale locale,
java.util.Locale displayLocale)
Returns the display name of a locale language.
|
java.util.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(java.util.Locale locale)
Install a new locale in the framework of andami.
|
java.util.Locale[] |
installLocales(java.io.File importFile)
Installs or a new locale (or a list) and its translation, or updates an
already existing one.
|
void |
setCurrentLocale(java.util.Locale locale)
Sets the current application locale.
|
void |
setDefaultLocales(java.util.Locale[] defaultLocales)
Sets the list of default locales bundled with gvSIG.
|
void |
setReferenceLocales(java.util.Locale[] referenceLocales)
Sets the list of default locales to export.
|
void |
uninstallLocale(java.util.Locale locale)
Uninstalls a locale and its translation.
|
public static I18nManager getInstance()
public static java.lang.String capitalize(java.lang.String text)
public java.util.Locale getCurrentLocale()
I18nManager
getCurrentLocale
in interface I18nManager
public java.util.Locale[] getInstalledLocales()
I18nManager
getInstalledLocales
in interface I18nManager
public void setCurrentLocale(java.util.Locale locale)
I18nManager
setCurrentLocale
in interface I18nManager
locale
- the current application localepublic java.util.Locale getDefaultSystemLocale()
I18nManager
getDefaultSystemLocale
in interface I18nManager
public void installLocale(java.util.Locale locale)
I18nManager
installLocale
in interface I18nManager
locale
- to installpublic void uninstallLocale(java.util.Locale locale) throws I18nException
I18nManager
uninstallLocale
in interface I18nManager
locale
- to uninstallI18nException
- if the locale can't be uninstalledpublic java.lang.String getDisplayName(java.util.Locale locale)
I18nManager
getDisplayName
in interface I18nManager
locale
- to get the display namepublic java.lang.String getDisplayName(java.util.Locale locale, java.util.Locale displayLocale)
I18nManager
getDisplayName
in interface I18nManager
locale
- to get the display namedisplayLocale
- the locale to display the namepublic java.lang.String getLanguageDisplayName(java.util.Locale locale)
I18nManager
getLanguageDisplayName
in interface I18nManager
locale
- to get the language display namepublic java.lang.String getLanguageDisplayName(java.util.Locale locale, java.util.Locale displayLocale)
I18nManager
getLanguageDisplayName
in interface I18nManager
locale
- to get the language display namedisplayLocale
- the locale to display the namepublic java.util.Locale[] installLocales(java.io.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(java.util.Locale locale, java.util.Locale referenceLocale, java.io.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(java.util.Locale[] locales, java.util.Locale referenceLocale, java.io.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(java.util.Locale locale, java.util.Locale referenceLocale, java.io.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(java.util.Locale locale, java.util.Locale[] referenceLocales, java.io.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 java.util.Locale[] getReferenceLocales()
I18nManager
getReferenceLocales
in interface I18nManager
public void setReferenceLocales(java.util.Locale[] referenceLocales)
I18nManager
setReferenceLocales
in interface I18nManager
referenceLocales
- the list of default locales to exportpublic void setDefaultLocales(java.util.Locale[] defaultLocales)
I18nManager
setDefaultLocales
in interface I18nManager