Package org.gvsig.i18n.impl
Class I18nManagerImpl
java.lang.Object
org.gvsig.i18n.impl.I18nManagerImpl
- All Implemented Interfaces:
I18nManager
Implementation of the I18nManager interface.
- Author:
- David Cervera, Cèsar Ordiñana
-
Field Summary
Fields inherited from interface org.gvsig.i18n.I18nManager
ENGLISH, SPANISH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Stringcapitalize(String text) voidexportLocaleForTranslation(Locale locale, Locale[] referenceLocales, File exportFile) Exports the keys of text to translate to a new locale to a jar file.voidexportLocaleForTranslation(Locale locale, Locale referenceLocale, File exportFile) Exports the keys of text to translate to a new locale to a jar file.voidexportLocaleForUpdate(Locale locale, Locale referenceLocale, File exportFile) Exports the translations of a locale to update or complete its translation, into a jar file.voidexportLocalesForUpdate(Locale[] locales, Locale referenceLocale, File exportFile) Exports the translations of a list of locales to update or complete its translation, into a jar file.Returns the current locale.Returns the application host system default locale.getDisplayName(Locale locale) Returns the display name of a locale.getDisplayName(Locale locale, Locale displayLocale) Returns the display name of a locale in the given locale to be displayed.Locale[]Returns the list of locales supported by the current gvSIG installation.static I18nManagerReturns the unique instance of the I18nManager.getLanguageDisplayName(Locale locale) Returns the display name of a locale language.getLanguageDisplayName(Locale locale, Locale displayLocale) Returns the display name of a locale language.Locale[]Returns the list of default locales to use as reference when exporting to translate a new locale, or update or complete an existing one.voidinstallLocale(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.voidsetCurrentLocale(Locale locale) Sets the current application locale.voidsetDefaultLocales(Locale[] defaultLocales) Sets the list of default locales bundled with gvSIG.voidsetReferenceLocales(Locale[] referenceLocales) Sets the list of default locales to export.voiduninstallLocale(Locale locale) Uninstalls a locale and its translation.
-
Constructor Details
-
I18nManagerImpl
public I18nManagerImpl()
-
-
Method Details
-
getInstance
Returns the unique instance of the I18nManager.- Returns:
- the unique instance
-
capitalize
-
getCurrentLocale
Description copied from interface:I18nManagerReturns the current locale.- Specified by:
getCurrentLocalein interfaceI18nManager- Returns:
- the current locale
-
getInstalledLocales
Description copied from interface:I18nManagerReturns the list of locales supported by the current gvSIG installation.- Specified by:
getInstalledLocalesin interfaceI18nManager- Returns:
- the list of locales supported
-
setCurrentLocale
Description copied from interface:I18nManagerSets the current application locale.- Specified by:
setCurrentLocalein interfaceI18nManager- Parameters:
locale- the current application locale
-
getDefaultSystemLocale
Description copied from interface:I18nManagerReturns the application host system default locale.- Specified by:
getDefaultSystemLocalein interfaceI18nManager- Returns:
- the default system locale
-
installLocale
Description copied from interface:I18nManagerInstall a new locale in the framework of andami. If the locale already exists update it.- Specified by:
installLocalein interfaceI18nManager- Parameters:
locale- to install
-
uninstallLocale
Description copied from interface:I18nManagerUninstalls a locale and its translation.- Specified by:
uninstallLocalein interfaceI18nManager- Parameters:
locale- to uninstall- Throws:
I18nException- if the locale can't be uninstalled
-
getDisplayName
Description copied from interface:I18nManagerReturns the display name of a locale.- Specified by:
getDisplayNamein interfaceI18nManager- Parameters:
locale- to get the display name- Returns:
- the locale display name
-
getDisplayName
Description copied from interface:I18nManagerReturns the display name of a locale in the given locale to be displayed.- Specified by:
getDisplayNamein interfaceI18nManager- Parameters:
locale- to get the display namedisplayLocale- the locale to display the name- Returns:
- the locale display name
-
getLanguageDisplayName
Description copied from interface:I18nManagerReturns the display name of a locale language.- Specified by:
getLanguageDisplayNamein interfaceI18nManager- Parameters:
locale- to get the language display name- Returns:
- the locale language display name
-
getLanguageDisplayName
Description copied from interface:I18nManagerReturns the display name of a locale language.- Specified by:
getLanguageDisplayNamein interfaceI18nManager- Parameters:
locale- to get the language display namedisplayLocale- the locale to display the name- Returns:
- the locale language display name
-
installLocales
Description copied from interface:I18nManagerInstalls or a new locale (or a list) and its translation, or updates an already existing one.- Specified by:
installLocalesin interfaceI18nManager- Parameters:
importFile- the jar or zip file which contains the locales and the translations as resource bundle files- Returns:
- the list of installed or updated locales
- Throws:
I18nException- if the locales could'n be installed
-
exportLocaleForUpdate
public void exportLocaleForUpdate(Locale locale, Locale referenceLocale, File exportFile) throws I18nException Description copied from interface:I18nManagerExports the translations of a locale to update or complete its translation, into a jar file. Into the file is also included the translations of another existing locale to be used as reference for updating the locale.- Specified by:
exportLocaleForUpdatein interfaceI18nManager- Parameters:
locale- the locale to update or completereferenceLocale- the locale to be used as referenceexportFile- the jar file to export to- Throws:
I18nException- if the locale could not be exported for update
-
exportLocalesForUpdate
public void exportLocalesForUpdate(Locale[] locales, Locale referenceLocale, File exportFile) throws I18nException Description copied from interface:I18nManagerExports the translations of a list of locales to update or complete its translation, into a jar file. Into the file is also included the translations of another existing locale to be used as reference for updating the locale.- Specified by:
exportLocalesForUpdatein interfaceI18nManager- Parameters:
locales- the locales to update or completereferenceLocale- the locale to be used as referenceexportFile- the jar file to export to- Throws:
I18nException- if the locale could not be exported for update
-
exportLocaleForTranslation
public void exportLocaleForTranslation(Locale locale, Locale referenceLocale, File exportFile) throws I18nException Description copied from interface:I18nManagerExports the keys of text to translate to a new locale to a jar file. Into the file is also included the translations of another existing locale to be used as reference for translating to the new locale.- Specified by:
exportLocaleForTranslationin interfaceI18nManager- Parameters:
locale- the new locale to translate toreferenceLocale- the locale to be used as referenceexportFile- the jar file to export to- Throws:
I18nException- if the locale could not be exported for translation
-
exportLocaleForTranslation
public void exportLocaleForTranslation(Locale locale, Locale[] referenceLocales, File exportFile) throws I18nException Description copied from interface:I18nManagerExports the keys of text to translate to a new locale to a jar file. Into the file is also included the translations of another existing locales to be used as reference for translating to the new locale.- Specified by:
exportLocaleForTranslationin interfaceI18nManager- Parameters:
locale- the new locale to translate toreferenceLocales- the locales to be used as referenceexportFile- the jar file to export to- Throws:
I18nException- if the locale could not be exported for translation
-
getReferenceLocales
Description copied from interface:I18nManagerReturns the list of default locales to use as reference when exporting to translate a new locale, or update or complete an existing one.- Specified by:
getReferenceLocalesin interfaceI18nManager- Returns:
- the list of default locales to export
-
setReferenceLocales
Description copied from interface:I18nManagerSets the list of default locales to export.- Specified by:
setReferenceLocalesin interfaceI18nManager- Parameters:
referenceLocales- the list of default locales to export
-
setDefaultLocales
Description copied from interface:I18nManagerSets the list of default locales bundled with gvSIG. That list of locales will be used as the list of installed ones when gvSIG is run for the first time with the I18n extension. The following times, that list will be taken form the extension configuration in the plugins persistence.- Specified by:
setDefaultLocalesin interfaceI18nManager- Parameters:
defaultLocales-
-