gluonhq / substrate

Create native Java(FX) apps for desktop, mobile and embedded
GNU General Public License v2.0
390 stars 52 forks source link

Local always "en" (Android/iOS) #1189

Open FlorianKirmaier opened 1 year ago

FlorianKirmaier commented 1 year ago

I've just noticed, that the language detection no longer works. I'm quite sure it worked before GraalVM was used.

When I call Locale.getDefault i always get back the locale "en", even if I set my device to German.

This happens on Android and iOS.

Is this a known issue? Is there another way to get the locale of the device?

("com.gluonhq:gluonfx-gradle-plugin:1.0.16" was used)

jperedadnr commented 1 year ago

See https://github.com/gluonhq/gluonfx-maven-plugin/issues/389 ?

FlorianKirmaier commented 1 year ago

Thank you for the quick response.

I'm a bit confused. This is not about adding the correct resources, The issue is that Local.getDefault always return "en".

Do the changes suggested in the other ticket, not just influence, which kind of resources are added? I've already got the correct resources in my project.

Or do they also change, which value Local.getDefault can return?

javateer commented 1 year ago

I want to confirm this. When I change my phone's default settings as if I am a non-english speaker from another country, I still get the same en default reply. In order for me to internationalize my app, I will have to ask the User again in my app's own Settings what i18n value do they prefer the app operates in among its available resource files. It would be better if we could use what the User has already set at the phone's OS level instead of our app asking them again.

FlorianKirmaier commented 1 year ago

Any news about this? I think it's quite an important feature to detect the Language of the user.

jperedadnr commented 7 months ago

There is a new issue in GraalVM about this topic: https://github.com/oracle/graal/issues/8295, proposing a possible solution and a roadmap.