com.vaadin.flow.spring.i18n.

Class DefaultI18NProviderFactory

java.lang.Object
com.vaadin.flow.spring.i18n.DefaultI18NProviderFactory

All Implemented Interfaces:

Serializable, org.springframework.context.annotation.Condition

public class DefaultI18NProviderFactory extends Object implements org.springframework.context.annotation.Condition, Serializable

Factory for DefaultI18NProvider. Factory creates I18N provider for locales based on all .properties files in /vaadin-i18n folder in the classpath including JAR contents.

See Also:

  • Field Details

    • DEFAULT_LOCATION_PATTERN

      public static final String DEFAULT_LOCATION_PATTERN

      Default location pattern to be used with ResourcePatternResolver.

      See Also:

  • Constructor Details

    • DefaultI18NProviderFactory

      public DefaultI18NProviderFactory()
  • Method Details

    • create

      public static DefaultI18NProvider create(String locationPattern)

      Creates new instance of DefaultI18NProvider with the given location pattern.

      Parameters:

      locationPattern - location pattern for ResourcePatternResolver to find translation files for available locales.

      Returns:

      new instance of DefaultI18NProvider. May be null.

      See Also:

      • ResourcePatternResolver
      • ResourcePatternResolver.getResources(String)

    • matches

      public boolean matches(org.springframework.context.annotation.ConditionContext context, org.springframework.core.type.AnnotatedTypeMetadata metadata)

      Specified by:

      matches in interface org.springframework.context.annotation.Condition