resource bundle for different language?

Hi, allI prepared 2 resource bundle for my application (english and chinese). Now it come to me, which resource bundle will be used if this application run on japanese or france operation system? chinese or english? Can I choose one as default?Thanks,Vincent Chen
[291 byte] By [VC@TWa] at [2007-10-1 21:01:24]
# 1

The resource bundle lookup searches for classes with various suffixes on the basis of (1) the desired locale and (2) the current default locale as returned by Locale.getDefault(), and (3) the root resource bundle (baseclass), from lower-level (more specific) to parent-level (less specific).

So the default in your case depends on:

1. Which language you put in your root resource bundle (most people use English in the root bundle, since it is most likely to be understood by somebody with a native language not covered by a resource bundle)

2. What your default locale is.

So, you need to ensure that you have the root resource bundle (no locale extension) in addition to your language-specific ones, and you need to take the default locale into consideration.

If you are writing an application that will be run directly on the client (not from a server), the problem is easy to solve: the default bundle will be used in all cases where the user's default locale does not match an existing resource bundle.

one_danea at 2007-7-13 2:58:06 > top of Java-index,Desktop,I18N...
# 2
Hi,Thank you very much for your answer. So, I already prepared languageBundle_en_US.properties and languageBundle_zh_TW.properties. If I create another languageBundle.properties, under any locale other that en_US or zh_TW will use this one. Is this correct?
VC@TWa at 2007-7-13 2:58:06 > top of Java-index,Desktop,I18N...
# 3
Yes, as long as you don't have a server locale in the mix, then you are right, all other locales will fall back to the default bundle with these files.
one_danea at 2007-7-13 2:58:06 > top of Java-index,Desktop,I18N...