B4J Question INLINE JAVA - Currency name not localized

Claudio Oliveira

Active Member
Licensed User
Longtime User
Hey!
On these quite boring quarentine days I decided to learn somthing about inline Java. To achieve that, I've chosen Java currency class and wrote a ridiculously small project.
Its goal is: get a locale string and show its currency name localized to the language part of the given locale.
Such as: en_GB woulde give me "British Pound", while fr_GB would give me "Livre Sterling", and so forth...
Just that.
OK, ok... I know there are Corwin's excellent libraries AHlocale and AHNumber which should do it far better than I could expect from my code, but my point is: LEARNING.
It works pretty fine. I can see currency names in almost any language of our quarentined world.
Good, but...
It only works if I run the project from inside B4J IDE.

When I compile it and run outside IDE, no localization happens and currency names are always in english language.
So weird... ?
Did I miss something?
Is there anything else I should do to make it work?
I'm using JDK 14.0.1 and JRE 1.8.0_251
Please find attached my tiny project.
Any help would be highly appreciated. ;)
Have a nice week, everybody!
 

Attachments

  • TEST1.zip
    2.6 KB · Views: 175

drgottjr

Expert
Licensed User
Longtime User
worked for me out of the box (at least when i input en_GB). i'm still using the original launch4j (to build an .exe) and jdk 1.8.something and jre 1.8.0_251. jdk 14 looks like it may be the outlier.
 
Upvote 0

Claudio Oliveira

Active Member
Licensed User
Longtime User
worked for me out of the box (at least when i input en_GB). i'm still using the original launch4j (to build an .exe) and jdk 1.8.something and jre 1.8.0_251. jdk 14 looks like it may be the outlier.

Thanks @drgottjr !
I'll try that.
Meanwhile, I tried to call "getAvailableLocales()" and Java returns only en_US.
From within B4J IDE, it returns over SEVEN HUNDRED locales (some of them are awkward, to say the least! ?)
Thanks again, mate!
 
Upvote 0
Top