camel-quarkus icon indicating copy to clipboard operation
camel-quarkus copied to clipboard

Broken native Locale support

Open ppalaga opened this issue 5 years ago • 7 comments

https://github.com/oracle/graal/issues/1645 and https://github.com/oracle/graal/issues/911 suggest that non-default locales won't work properly in native mode. We should check whether we can leverage the workaround mentioned in https://stackoverflow.com/questions/61567216/graalvm-quarkus-locale-in-native-mode/61594634#61594634

If the workaround works for us, we can use it to "register" Locale.ENGLISH required by Geocoder.

ppalaga avatar Oct 01 '20 09:10 ppalaga

Substituting java.text.DecimalFormatSymbols.getInstance(Locale) would solve the issue with String.format(Locale.ROOT, "%.1f", double) in Geocoder. I have a PoC, but it is a bit fragile and hard to generalize. I do not think it is worth having it just to solve the GeoCoder issue. Hopefully GraalVM comes with a proper non-default locale support soon https://github.com/oracle/graal/issues/2908

ppalaga avatar Oct 12 '20 21:10 ppalaga

There is another linked issue in quarkus https://github.com/quarkusio/quarkus/issues/5244.

aldettinger avatar Mar 29 '21 14:03 aldettinger

GraalVM 21.1 seems to bring some options control the locales embedded into the native image and we probably want to wait for https://github.com/quarkusio/quarkus/issues/5244 to provide config and programmatic access to those.

ppalaga avatar Apr 20 '21 21:04 ppalaga

Hi @ppalaga ,

Just FYI, if it's only one no-default locale needed in native mode, we can specify it in application.properties like

quarkus.native.user-country=US
quarkus.native.user-language=en

Please take a look at https://github.com/apache/camel-quarkus/issues/2550#issuecomment-832204615 to get more details.

Cheers Freeman

ffang avatar May 05 '21 16:05 ffang

if it's only one no-default locale needed in native mode, we can specify it in application.properties like

quarkus.native.user-country=US
quarkus.native.user-language=en

Yes, thanks, I was not aware of those props. Indeed they may come in handy to workaround some native locale issues.

ppalaga avatar May 10 '21 09:05 ppalaga

We need to adapt our documentation https://github.com/apache/camel-quarkus/pull/2601/files once quarkusio/quarkus#5244 gets fixed.

ppalaga avatar May 17 '21 15:05 ppalaga

https://github.com/quarkusio/quarkus/issues/5244 has been fixed

apupier avatar Oct 07 '25 15:10 apupier