Class LocaleProcessor


  • public class LocaleProcessor
    extends Object
    In order for a Native image built app to be able to use localized names of e.g. countries, these language bundles have to be loaded. JDK uses ServiceLoader approach for that. For instance, Locale.FRANCE.getDisplayCountry(Locale.GERMAN) must print "Frankreich".
    • Constructor Detail

      • LocaleProcessor

        public LocaleProcessor()
    • Method Detail

      • nativeImageUserLanguage

        public static String nativeImageUserLanguage​(NativeConfig nativeConfig,
                                                     LocalesBuildTimeConfig localesBuildTimeConfig)
        User language for native-image executable.
        Parameters:
        nativeConfig -
        localesBuildTimeConfig -
        Returns:
        User language set by 'quarkus.default-locale' or by deprecated 'quarkus.native.user-language' or effectively LocalesBuildTimeConfig.DEFAULT_LANGUAGE if none of the aforementioned is set.
      • nativeImageUserCountry

        public static String nativeImageUserCountry​(NativeConfig nativeConfig,
                                                    LocalesBuildTimeConfig localesBuildTimeConfig)
        User country for native-image executable.
        Parameters:
        nativeConfig -
        localesBuildTimeConfig -
        Returns:
        User country set by 'quarkus.default-locale' or by deprecated 'quarkus.native.user-country' or effectively LocalesBuildTimeConfig.DEFAULT_COUNTRY (could be an empty string) if none of the aforementioned is set.
      • nativeImageIncludeLocales

        public static String nativeImageIncludeLocales​(NativeConfig nativeConfig,
                                                       LocalesBuildTimeConfig localesBuildTimeConfig)
        Additional locales to be included in native-image executable.
        Parameters:
        nativeConfig -
        localesBuildTimeConfig -
        Returns:
        A comma separated list of IETF BCP 47 language tags, optionally with ISO 3166-1 alpha-2 country codes.