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

How to read property file  RSS feed

 
P Kulkarni
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!
 
Bauke Scholtz
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!