aspose file tools*
The moose likes Java in General and the fly likes internationalization Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "internationalization" Watch "internationalization" New topic
Author

internationalization

aymane chetibi
Ranch Hand

Joined: Apr 12, 2006
Posts: 175
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
Marshal

Joined: Mar 22, 2005
Posts: 41494
    
  53
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.


Ping & DNS - my free Android networking tools app
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
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.


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

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

Joined: Apr 12, 2006
Posts: 175
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

Joined: Apr 12, 2006
Posts: 175
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
Marshal

Joined: Mar 22, 2005
Posts: 41494
    
  53
Keys can not contain spaces - use a dot or hyphen instead.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: internationalization