Interface I18nManager

All Known Implementing Classes:
I18nManagerImpl

public interface I18nManager
Management of I18n and Locale related activities.
Author:
David Cervera, Cèsar Ordiñana
  • Field Details

    • SPANISH

      static final Locale SPANISH
    • ENGLISH

      static final Locale ENGLISH
  • Method Details

    • getLanguageDisplayName

      String getLanguageDisplayName(Locale locale, Locale displayLocale)
      Returns the display name of a locale language.
      Parameters:
      locale - to get the language display name
      displayLocale - the locale to display the name
      Returns:
      the locale language display name
    • getLanguageDisplayName

      String getLanguageDisplayName(Locale locale)
      Returns the display name of a locale language.
      Parameters:
      locale - to get the language display name
      Returns:
      the locale language display name
    • getDisplayName

      String getDisplayName(Locale locale, Locale displayLocale)
      Returns the display name of a locale in the given locale to be displayed.
      Parameters:
      locale - to get the display name
      displayLocale - the locale to display the name
      Returns:
      the locale display name
    • getDisplayName

      String getDisplayName(Locale locale)
      Returns the display name of a locale.
      Parameters:
      locale - to get the display name
      Returns:
      the locale display name
    • getCurrentLocale

      Locale getCurrentLocale()
      Returns the current locale.
      Returns:
      the current locale
    • setCurrentLocale

      void setCurrentLocale(Locale locale)
      Sets the current application locale.
      Parameters:
      locale - the current application locale
    • getDefaultSystemLocale

      Locale getDefaultSystemLocale()
      Returns the application host system default locale.
      Returns:
      the default system locale
    • getInstalledLocales

      Locale[] getInstalledLocales()
      Returns the list of locales supported by the current gvSIG installation.
      Returns:
      the list of locales supported
    • installLocales

      Locale[] installLocales(File importFile) throws I18nException
      Installs or a new locale (or a list) and its translation, or updates an already existing one.
      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
    • uninstallLocale

      void uninstallLocale(Locale locale) throws I18nException
      Uninstalls a locale and its translation.
      Parameters:
      locale - to uninstall
      Throws:
      I18nException - if the locale can't be uninstalled
    • exportLocaleForUpdate

      void exportLocaleForUpdate(Locale locale, Locale referenceLocale, File exportFile) throws I18nException
      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.
      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

      void exportLocalesForUpdate(Locale[] locales, Locale referenceLocale, File exportFile) throws I18nException
      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.
      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

      void exportLocaleForTranslation(Locale locale, Locale referenceLocale, File exportFile) throws I18nException
      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.
      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

      void exportLocaleForTranslation(Locale locale, Locale[] referenceLocales, File exportFile) throws I18nException
      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.
      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

      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.
      Returns:
      the list of default locales to export
    • setReferenceLocales

      void setReferenceLocales(Locale[] referenceLocales)
      Sets the list of default locales to export.
      Parameters:
      referenceLocales - the list of default locales to export
    • setDefaultLocales

      void setDefaultLocales(Locale[] defaultLocales)
      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.
      Parameters:
      defaultLocales -
    • installLocale

      void installLocale(Locale locale)
      Install a new locale in the framework of andami. If the locale already exists update it.
      Parameters:
      locale - to install