• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

internationalization

 
aymane chetibi
Ranch Hand
Posts: 175
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello all,
I am working on the internationalization of a big project.
can anybody tell me where should I put the .properties files so that the program can find them and what should I name them exactly.

Iam receiving the following exception:
java.util.MissingResourceException: Can't find bundle for base name MessagesBundle, locale fr_MOR

thanks alot for your help.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The files should be in the classpath. I think that the error message states that a file called "MessagesBundle_fr_MOR.properties" is missing. It's unusual to have a three-letter country designation like "MOR"; usually that should only be two letters.
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ulf Dittmer:
The files should be in the classpath. I think that the error message states that a file called "MessagesBundle_fr_MOR.properties" is missing.


Either that, or

MessagesBundle_fr.properties

or

MessagesBundle.properties

If I remember correctly, you can even have all three, and a key will be searched in all of them, from most specific to more general.
 
Paul Clapham
Sheriff
Posts: 21416
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guessing that aymane chetibi meant "Morocco" ("Maroc" in French), the country designation is "ma". So the locale would be "fr_MA". But I find it a little surprising that the ResourceBundle code itself is looking for "fr_MOR"; perhaps the underlying code has a locale constructed in the same way.
 
aymane chetibi
Ranch Hand
Posts: 175
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes I meant Morocco.
I changed it before I saw your message to fr_MR and still got the same error.
java.util.MissingResourceException: Can't find bundle for base name MessagesBundle, locale fr_MR

do I have to have three files ? I want to have 2 languages, english and french. and do I have to have the country designation of can I have just MessagesBundle_fr.properties?

Also, how can I check if they are in the class path ?

thanks alot
 
aymane chetibi
Ranch Hand
Posts: 175
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got it fixed. it was a class path issue.
now when the key contains a space it doesnt work.
does anybody knows why ?

for example: "user password" cannot be found as a key.

thanks alot
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Keys can not contain spaces - use a dot or hyphen instead.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic