Class TranslationService

  • @Service
    public class TranslationService
    extends Object
    This service provides I18N support for the application
    Charles Edward Bedon Cortazar <>
    • Constructor Detail

      • TranslationService

        public TranslationService()
    • Method Detail

      • getCurrentLanguage

        public Locale getCurrentLanguage()
      • getSupportedLanguage

        public Locale getSupportedLanguage​(String locale)
      • setCurrentlanguage

        public void setCurrentlanguage​(String locale)
                                throws IllegalArgumentException
        Sets the current language through a locale.
        locale - The locale string. This might be in the form language_VARIANT or simple language. Comparison is case-insensitive. See the contents of i18n resource folder in this project for currently supported languages. If not found, it will fallback to English.
        IllegalArgumentException - If the locale is not supported.
      • getTranslatedString

        public String getTranslatedString​(String key)