Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

java.util.Locale  RSS feed

 
Muhammad Ahsan Jamshaid
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All..
How to use Loacale is fine... but where and why to use them is troubling me.. Actually concept to clear regarding it .. Any help fellows..

--Jamhaid..
 
Srinivas Kalvala
Ranch Hand
Posts: 257
Firefox Browser Hibernate Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

Assume you are desiging one application to run in different parts of the world, then think how can you make your application to take the local currency, langugae, number position, date, time, etc in which the application is working?

All the best ...
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its used in internationalized application to learn about the location/language and stuffs like that of the user.Using the browsers request , the server constructs the Locale object and stores in the HTTPServeltRequest object.That in turn can be used by the application.
 
Muhammad Ahsan Jamshaid
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi...

Any Practicle Example??.. I did not got the point yet...
 
Muhammad Ahsan Jamshaid
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what i got from these is.. For a Global Application i can define different locales and then can manage my application according to the particular user Loacale..

--Jamshaid..
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1> Open www.orkut.com , notice that the text in the site are appearing in english.

2> Change the language of the IE (tools->internet options->language) to japneese.

3> Open another session of www.orkut.com in another browser.You will notice that all the texts are appearing in japneese..

The reason is www.orkut.com is an internationalized web application.So all the texts come from resource bundles.As the application is internationalized it can be localized to any local , just by adding appropriate resource bundle to the application.
There are many other stuffs which makes a application truly I18N , this is one of those.
 
Muhammad Ahsan Jamshaid
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks dear... i got the point..

--Jamshiad..
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!