Class I18nManagerImpl

java.lang.Object
org.gvsig.i18n.impl.I18nManagerImpl
All Implemented Interfaces:
I18nManager

public class I18nManagerImpl extends Object implements I18nManager
Implementation of the I18nManager interface.
Author:
David Cervera, Cèsar Ordiñana
  • Constructor Details

    • I18nManagerImpl

      public I18nManagerImpl()
  • Method Details

    • getInstance

      public static I18nManager getInstance()
      Returns the unique instance of the I18nManager.
      Returns:
      the unique instance
    • capitalize

      public static String capitalize(String text)
    • getCurrentLocale

      public Locale getCurrentLocale()
      Description copied from interface: I18nManager
      Returns the current locale.
      Specified by:
      getCurrentLocale in interface I18nManager
      Returns:
      the current locale
    • getInstalledLocales

      public Locale[] getInstalledLocales()
      Description copied from interface: I18nManager
      Returns the list of locales supported by the current gvSIG installation.
      Specified by:
      getInstalledLocales in interface I18nManager
      Returns:
      the list of locales supported
    • setCurrentLocale

      public void setCurrentLocale(Locale locale)
      Description copied from interface: I18nManager
      Sets the current application locale.
      Specified by:
      setCurrentLocale in interface I18nManager
      Parameters:
      locale - the current application locale
    • getDefaultSystemLocale

      public Locale getDefaultSystemLocale()
      Description copied from interface: I18nManager
      Returns the application host system default locale.
      Specified by:
      getDefaultSystemLocale in interface I18nManager
      Returns:
      the default system locale
    • installLocale

      public void installLocale(Locale locale)
      Description copied from interface: I18nManager
      Install a new locale in the framework of andami. If the locale already exists update it.
      Specified by:
      installLocale in interface I18nManager
      Parameters:
      locale - to install
    • uninstallLocale

      public void uninstallLocale(Locale locale) throws I18nException
      Description copied from interface: I18nManager
      Uninstalls a locale and its translation.
      Specified by:
      uninstallLocale in interface I18nManager
      Parameters:
      locale - to uninstall
      Throws:
      I18nException - if the locale can't be uninstalled
    • getDisplayName

      public String getDisplayName(Locale locale)
      Description copied from interface: I18nManager
      Returns the display name of a locale.
      Specified by:
      getDisplayName in interface I18nManager
      Parameters:
      locale - to get the display name
      Returns:
      the locale display name
    • getDisplayName

      public String getDisplayName(Locale locale, Locale displayLocale)
      Description copied from interface: I18nManager
      Returns the display name of a locale in the given locale to be displayed.
      Specified by:
      getDisplayName in interface I18nManager
      Parameters:
      locale - to get the display name
      displayLocale - the locale to display the name
      Returns:
      the locale display name
    • getLanguageDisplayName

      public String getLanguageDisplayName(Locale locale)
      Description copied from interface: I18nManager
      Returns the display name of a locale language.
      Specified by:
      getLanguageDisplayName in interface I18nManager
      Parameters:
      locale - to get the language display name
      Returns:
      the locale language display name
    • getLanguageDisplayName

      public String getLanguageDisplayName(Locale locale, Locale displayLocale)
      Description copied from interface: I18nManager
      Returns the display name of a locale language.
      Specified by:
      getLanguageDisplayName in interface I18nManager
      Parameters:
      locale - to get the language display name
      displayLocale - the locale to display the name
      Returns:
      the locale language display name
    • installLocales

      public Locale[] installLocales(File importFile) throws I18nException
      Description copied from interface: I18nManager
      Installs or a new locale (or a list) and its translation, or updates an already existing one.
      Specified by:
      installLocales in interface I18nManager
      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: I18nManager
      Exports 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:
      exportLocaleForUpdate in interface I18nManager
      Parameters:
      locale - the locale to update or complete
      referenceLocale - the locale to be used as reference
      exportFile - 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: I18nManager
      Exports 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:
      exportLocalesForUpdate in interface I18nManager
      Parameters:
      locales - the locales to update or complete
      referenceLocale - the locale to be used as reference
      exportFile - 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: I18nManager
      Exports 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:
      exportLocaleForTranslation in interface I18nManager
      Parameters:
      locale - the new locale to translate to
      referenceLocale - the locale to be used as reference
      exportFile - 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: I18nManager
      Exports 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:
      exportLocaleForTranslation in interface I18nManager
      Parameters:
      locale - the new locale to translate to
      referenceLocales - the locales to be used as reference
      exportFile - the jar file to export to
      Throws:
      I18nException - if the locale could not be exported for translation
    • getReferenceLocales

      public Locale[] getReferenceLocales()
      Description copied from interface: I18nManager
      Returns 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:
      getReferenceLocales in interface I18nManager
      Returns:
      the list of default locales to export
    • setReferenceLocales

      public void setReferenceLocales(Locale[] referenceLocales)
      Description copied from interface: I18nManager
      Sets the list of default locales to export.
      Specified by:
      setReferenceLocales in interface I18nManager
      Parameters:
      referenceLocales - the list of default locales to export
    • setDefaultLocales

      public void setDefaultLocales(Locale[] defaultLocales)
      Description copied from interface: I18nManager
      Sets 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:
      setDefaultLocales in interface I18nManager
      Parameters:
      defaultLocales -