• Post Reply Bookmark Topic Watch Topic
  • New Topic

ResourceBundle.Control  RSS feed

 
Enkita mody
Ranch Hand
Posts: 333
Firefox Browser Java Windows XP
  • Mark post as helpful
  • send pies
  • 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 Java Windows XP
  • Mark post as helpful
  • send pies
  • 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 ?
 
Tony Docherty
Bartender
Posts: 3268
82
  • Mark post as helpful
  • send pies
  • 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 Java Windows XP
  • Mark post as helpful
  • send pies
  • 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: 3268
82
  • Mark post as helpful
  • send pies
  • 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).
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16028
87
Android IntelliJ IDE Java Scala Spring
  • Likes 1
  • Mark post as helpful
  • send pies
  • 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: 3268
82
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!