Class I18NUtil

java.lang.Object
com.vaadin.flow.i18n.I18NUtil

public final class I18NUtil extends Object
Utility class for use with determining default i18n property files and locales.

For internal use only. May be renamed or removed in a future release.

  • Field Details

  • Constructor Details

    • I18NUtil

      public I18NUtil()
  • Method Details

    • containsDefaultTranslation

      public static boolean containsDefaultTranslation()
      Check if we have a default translation properties file DefaultI18NProvider.BUNDLE_FILENAME in the folder DefaultI18NProvider.BUNDLE_FOLDER

      For internal use only. May be renamed or removed in a future release.

      Returns:
      true if default property file found
    • getDefaultTranslationLocales

      public static List<Locale> getDefaultTranslationLocales()
      Check that we have the translation folder DefaultI18NProvider.BUNDLE_FOLDER and collect all translation properties files. Parse names to get locales.

      For internal use only. May be renamed or removed in a future release.

      Returns:
      List of locales parsed from property files.
    • collectLocalesFromFileNames

      public static List<Locale> collectLocalesFromFileNames(List<String> fileNames)
      Get list of locales collected from the given list of translation file names.
      Parameters:
      fileNames - List of file names
      Returns:
      List of locales
    • getTranslationFiles

      protected static List<File> getTranslationFiles(URL resource)
    • getClassLoader

      protected static ClassLoader getClassLoader()
    • getLogger

      protected static org.slf4j.Logger getLogger()