Locales default set at run-time starting with GraalVM/Mandrel 24.2 for JDK 24, how to handle in Quarkus? #43533
Replies: 4 comments 13 replies
-
As an example compiling and running the following code compiled with import java.util.Locale;
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello World! The default locale is " + Locale.getDefault());
for (Locale availableLocale : Locale.getAvailableLocales()) {
System.out.println(availableLocale);
}
}
} gives the following results in the corresponding version:
Note that the locale of the system I build on is If I recompile using
|
Beta Was this translation helpful? Give feedback.
-
There's something missing from your explanation, I think: https://quarkus.io/guides/all-config#quarkus-core_quarkus-locales
The default value is: Sounds to me like Confusingly, |
Beta Was this translation helpful? Give feedback.
-
There was a zulip discussion leading to this: #43578 |
Beta Was this translation helpful? Give feedback.
-
Is the rationale for the change in graalvm just "be more like jvm" ? what is the actual behavior we think would be nice? I'm assuming its one where we can limit how many locales data gets included into the image? Is that still possible in latest graalvm 24? |
Beta Was this translation helpful? Give feedback.
-
With GraalVM/Mandrel prior to 24.2.0 the default locale (and included locale) for a native executable was determined (and implicitly included in the image) by either:
user.language
anduser.country
or
quarkus.default-locale
or
quarkus.native.user-language
andquarkus.native.country
(Deprecated)settings at native executable build time.
Starting with GraalVM/Mandrel 24.2.0 for JDK 24 the build settings of language/country have no effect in terms of included locales (as in the build time locale is not included implicitly) in the resulting native executable. Furthermore, the default locale is determined at runtime based on the locale of the system the native executable runs on, which is on par with how it works in JVM-mode, with the notable difference that if one wants to use a locale not explicitly added to the image it won't work (it will fallback to English).
#43448 takes a step towards handling this, by automatically including in the native executable the locale defined by either:
quarkus.default-locale
or
quarkus.native.user-language
andquarkus.native.country
(Deprecated)but doesn't consider
user.language
noruser.country
.The questions are:
user.language
anduser.country
properties to the above list?quarkus.locales
and ignore the build-time default locale?Beta Was this translation helpful? Give feedback.
All reactions