Package io.quarkus.deployment.steps
Class LocaleProcessor
- java.lang.Object
-
- io.quarkus.deployment.steps.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".
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
LocaleProcessor.NonDefaultLocale
We activate additional resources in native-image executable only if user opts for anything else than what is already the system default.
-
Field Summary
Fields Modifier and Type Field Description static String
DEPRECATED_USER_COUNTRY_WARNING
static String
DEPRECATED_USER_LANGUAGE_WARNING
-
Constructor Summary
Constructors Constructor Description LocaleProcessor()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static String
nativeImageIncludeLocales(NativeConfig nativeConfig, LocalesBuildTimeConfig localesBuildTimeConfig)
Additional locales to be included in native-image executable.static String
nativeImageUserCountry(NativeConfig nativeConfig, LocalesBuildTimeConfig localesBuildTimeConfig)
User country for native-image executable.static String
nativeImageUserLanguage(NativeConfig nativeConfig, LocalesBuildTimeConfig localesBuildTimeConfig)
User language for native-image executable.(package private) void
nativeResources(BuildProducer<NativeImageResourceBundleBuildItem> resources)
(package private) void
servicesResource(BuildProducer<NativeImageResourceBuildItem> nativeImageResources, BuildProducer<GeneratedResourceBuildItem> generatedResources)
(package private) ReflectiveClassBuildItem
setupReflectionClasses()
-
-
-
Field Detail
-
DEPRECATED_USER_LANGUAGE_WARNING
public static final String DEPRECATED_USER_LANGUAGE_WARNING
- See Also:
- Constant Field Values
-
DEPRECATED_USER_COUNTRY_WARNING
public static final String DEPRECATED_USER_COUNTRY_WARNING
- See Also:
- Constant Field Values
-
-
Method Detail
-
nativeResources
void nativeResources(BuildProducer<NativeImageResourceBundleBuildItem> resources)
-
setupReflectionClasses
ReflectiveClassBuildItem setupReflectionClasses()
-
servicesResource
void servicesResource(BuildProducer<NativeImageResourceBuildItem> nativeImageResources, BuildProducer<GeneratedResourceBuildItem> generatedResources)
-
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.
-
-