We use the standard ResourceBundle mechanism to get these properties and ResourceBundle uses Locale objects to determine which names it should look at. It uses both a supplied Locale, if there is one, and the default Locale.
In BibleDesktop, we set the default Locale when the program starts if the user has picked a particular locale in which they want to display.
We use that default to get the resources.
Rather than experimenting, I looked at the code for Java 1.4.2 and Java 1.6. Regarding this, both are the same. When creating a new Locale with a language code of either "in" or "id", Java will store "in". It does not know, remember or care that "id" and "in" are aliases of each other. It promptly forgets that "id" was passed into the constructor.
So, for the property files to work as a resource bundle for all Indonesian speakers, we need to name them filename_in.properties. Naming them filename_in_ID.properties will only work when the supplied country is ID.
I'll remove the _ID from the files and check them in.
Tonny, thank you so very much for this!
I do have a question. Is this to be only for Indonesian speakers in Indonesia? Or is it for all Indonesian speakers regardless of where they are?. Or another way to ask, should these files be the default files for the language?
If it is for the latter, I'll remove the _ID from the file names. That way it is not location dependent.
Typically we don't put a country code on the property files that are the first for the language, especially when it is the country of origin. That way if a speaker of that language is in another country, they can get the language. For example, if the base files were xyz_pt_PT.properties and there were no xyz_pt.properties then a Portuguese speaker in Brazil with a locale of pt_BR would not get Portuguese. (Portuguese in Portugal and in Brazil are very different dialects, but they can understand each other.)