• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

ResourceBundle.Control

 
Ranch Hand
Posts: 333
Firefox Browser Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

---------- Run ----------
region : China
language : simplified chinese
region : Tiwan
language : Traditional chinese
region : global
language : english
region : Hong Kong
language : simplified chinese

--------------------
region : China
language : simplified chinese
region : Tiwan
language : Traditional chinese
region : global
language : english
region : Hong Kong
language : simplified chinese

Output completed (0 sec consumed) - Normal Termination

I couldn't figure out.I'm wondering, for CustomizeImplementation() why is it simplified chinese for Hong Kong region ? there must be Traditional chinese.

I don't understand,what does it mean ?
 
Enkita mody
Ranch Hand
Posts: 333
Firefox Browser Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

---------- Run ----------
region : China
language : simplified chinese
region : Taiwan
language : Traditional Chinese
region : global
language : english
region : Hong Kong
language : Traditional Chinese

Output completed (0 sec consumed) - Normal Termination

It is weird, when i do comment out above codes, it gives correct output else not.

Would you like to elaborate this mystery ?
 
Bartender
Posts: 3323
86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The code you have posted can't be the code you have run as it won't compile so it's not possible to make a definitive comment.

The ResourceBundle for language code "zh-HK" doesn't specify a language and so to get a language it will use the next less specific locale which I imagine is RBControl_zh which specifies a language of simplified chinese. I say "I imagine" because I've never used forLanguageCode() before and so am not sure how they map the code to the resource bundle name. If it is a straight mapping then you will get the language you desire if you use "zh-TW".

It is weird, when i do comment out above codes, it gives correct output else not.


I would say this is not the correct output given the code you posted earlier but then again it's not the code you are running.
 
Enkita mody
Ranch Hand
Posts: 333
Firefox Browser Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tony Docherty wrote:The code you have posted can't be the code you have run as it won't compile so it's not possible to make a definitive comment.


It compiles perfectly,please ensure that resources classes are in separate files, could you put your compile errors here ?

 
Tony Docherty
Bartender
Posts: 3323
86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

It compiles perfectly,please ensure that resources classes are in separate files, could you put your compile errors here ?


I haven't actually compiled it but a couple of the methods have the parameter "Locale current locale" which isn't legal.
I guess it's supposed to be "Locale current_locale" (which BTW doesn't conform to Java naming standards).
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tony Docherty wrote:I haven't actually compiled it but a couple of the methods have the parameter "Locale current locale" which isn't legal.
I guess it's supposed to be "Locale current_locale" (which BTW doesn't conform to Java naming standards).


There's a bug in the JavaRanch forum software so that some users don't see some of the underscores in a code block. That's probably what you see too.
 
Tony Docherty
Bartender
Posts: 3323
86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for that info Jesper. I've just copied the displayed code (which doesn't show any underscores) and pasted it into my IDE and the underscores are there.
Apologies Ankita I couldn't see the underscores but it appears they are really there.
 
What a stench! Central nervous system shutting down. Save yourself tiny ad!
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic