Clone the default bundle or not?

We have a JSF application that is programmed to support three languages - English, German, and Dutch. On the first page of the application, we ask the user to select their language, and then apply a Locale object to the JSF session based on their selection.

Our message bundles are currently configured as follows:

msgs.properties - default bundle containing english text

msgs_de.properties - german translations

msgs_nl.properties - dutch translations

On a test XP system, configured in UK English, then it is possible to select any of the three languages and have the correct language displayed when browsing the site.

On a test XP system, configured in Dutch, then selecting either Dutch or German gives the expected language, but selecting English results in the site being presented in Dutch.

My *assumption* here, is that the following is happening:

1) user selects English...a Locale object is created for en_GB

2) JSF attempts to find msgs_en.properties but fails to find it

3) JSF realises (perhaps from accept-language headers?) that a properties file DOES exist that matches Windows' settings, ie Dutch, so it uses that.

My original expectation for this would have been that it would go looking for msgs_en.properties, fail to find it, and therefore fall back to the default file and use that.

One solution would appear to be to create both a msgs.properties file *and* a msgs_en.properties file (containing the same data). Indeed, this appears to be what's happening in the Java trail example for i18n:

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

Although they never explicitly mention that this is what they've done.

This solution also ends up generating a large amount of redundant files, and is just asking for mistakes to be made, especially with a large application with many properties files.

Another solution is to not provide a default bundle at all, however this causes errors for keys that have not yet been translated into all languages, and would seem silly for situations where you might want to have a default file containing, for example, 100 British English key/values and then a small US English file with just a couple of modified values due to spelling differences.

Does anyone have other suggestions or know the correct way to go about resolving this?

[2416 byte] By [iainmilnea] at [2007-11-27 7:34:19]
# 1
An easy workaround is to provide empty msgs_en.properties so that ResourceBundle takes that properties file for en_GB. It's a bit overhead to look up the empty bundle, but it shouldn't affect performance too much.Masayoshi
okutsua at 2007-7-12 19:14:47 > top of Java-index,Desktop,I18N...