How to realize czech texts with ResourceBundles

Hi!

I have got a big problem trying to make one of our german applications available in czech.

We are using ResourceBundles with .properties files for our texts and have now translated them into czech. When loading the bundle by calling:

ResourceBundle rb = ResourceBundle.getBundle("x.x.x.BundleName", locale);

all seems to work and there is no exception thrown.

But when i try to get any text out of it i.e. by calling:

rb.getString("name");

i get an exception:

java.util.MissingResourceException: Can't find resource for bundle java.util.PropertyResourceBundle, key name

I tryied to use native2ascii with several encodings (Cp1252, ISO-8859-1, ISO-8859-2, UTF-8, UTF-16, ...) but i never got one that realy works the way i want. Most of the encodings i tryied changes some of the special characters in the file but also left some of them so that i can get some translated texts but most of them with boxes or question symbols within. native2ascii with UTF-8 encoding only answers with a sun.io.MalformedInputException in the comand line. UTF-16 initially looked fine cause nearly all special characters was translated into \uXXXX escape sequences but also there i got a problem with one special character: ?(hope it will be displayed correctly here). This character seems to annoy the native2ascii tool cause the following characters would also be translated into escape sequences even if this is not necessary. Also i got some question symbols in the GUI again (having the charset in the HTML/JSP file set to UTF-16).

I don't know why the original translated property file could not be read in getting an exception only when trying to get a text not when loading the file. Another thing confusing me is that all encodings (except UTF-16) that i tryied for the translated file corrupted the file by seperating each character with a blank one (so i.e.name = jm閚o appered asn a m e = j m \u00e9 n o).

Some of the special characters in the translation are: ?(and also some other characters with those symbols).

Please can anyone help me or does anyone has experiences with translating a (web) project to czech or any similar/related language.

Thanks a lot

Juergen

[2331 byte] By [fuchs.ja] at [2007-10-1 20:55:46]
# 1

Without knowing what you've written or how you named your file, it's hard to give you advice. But I've the feeling that you've mixed up the notions of locale and encoding. Have you read the tutorial on i18n and follow it? If no, here it is:

http://java.sun.com/docs/books/tutorial/i18n/index.html

horiniusa at 2007-7-13 2:52:43 > top of Java-index,Desktop,I18N...
# 2

You also seem to have a problem with using native2ascii. You say that you tried to use it with Cp1252, ISO-8859-1 (among others), but how can you possibly have a Czech file in those code pages? They don't support the Czech characters set. You simply need to know which source code page your file is actually in, and then run native2ascii on the file specifying that encoding. I have never had a problem executing native2ascii on a Czech file, it seems to work just fine - as long as the correct source encoding is used.

one_danea at 2007-7-13 2:52:43 > top of Java-index,Desktop,I18N...