• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

How to read property file

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I am working on already developed project. I have to provide localization for French language. I have proerty file for English. When I add another file in french and build the code it picks up english file as default file.
How can I make locale selection dynamic so that it will also work in french.

Another issue:
Here is the example of the property file content.

[yesButtonText "Yes"]
[noButtonText "No"]

now suppose 'yesButtonText' is key and'Yes' is value. But strange thing is that I am not getting key in my code anywhere.
Is it possible there exists hierarchy of key value like

A->B->C

A is key B is value
B is Key c is value


Can anyone help me out??

Thanks!
 
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by P Kulkarni:
Hi all,

I am working on already developed project. I have to provide localization for French language. I have proerty file for English. When I add another file in french and build the code it picks up english file as default file.
How can I make locale selection dynamic so that it will also work in french.


Read on about the possibilities which the JDK can provide you on the area of internationalization (i18n): http://java.sun.com/docs/books/tutorial/i18n/index.html


Another issue:
Here is the example of the property file content.

[yesButtonText "Yes"]
[noButtonText "No"]

now suppose 'yesButtonText' is key and'Yes' is value. But strange thing is that I am not getting key in my code anywhere.
Is it possible there exists hierarchy of key value like

A->B->C

A is key B is value
B is Key c is value


Can anyone help me out??

Thanks!


You want something like properties.get(properties.get("A")) or so? Well, that's fairly straightforward to code it together yourself.
[ December 21, 2008: Message edited by: Bauke Scholtz ]
 
P Kulkarni
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the link.
It sounds good!
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're welcome.
 
You ridiculous clown, did you think you could get away with it? This is my favorite tiny ad!
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic