• Post Reply Bookmark Topic Watch Topic
  • New Topic

Default Language Properties file  RSS feed

 
Prasad Babu
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

My scenario is, I have 2 or more language properties files for different langauges. My problem is, if the specified key element is not there in the corresponding properties file, it has to take the corresponding key value from English properties file. Is there any way to do so?

Thanks in advance,
Prasad.
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Store the English file without any language extension, and it will be the default file. E.g. if you have files xyz_hi.properties and xyz_fr.properties, name the English one "xyz.properties".
 
Prasad Babu
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ulf Dittmer,

Thank you for reply.

But the trick you suggested is not working fine. any another way?

Thanks in advance,
Prasad
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What I suggested is not a trick - it's how the language selection process works with property files. What does you directory/class/property file layout look like, and what code do you use to load them?
[ May 14, 2006: Message edited by: Ulf Dittmer ]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!