[jsword-devel] BibleInfo#englishBibleNames may not contain English book names in I18Ned locales
Brian Fernandes
infernalproteus at gmail.com
Sun Feb 1 10:00:16 MST 2009
When you ask for a bundle for a specific language, Java attempts to
locate the bundle in the following order (relevant to how JSword uses
it, real logic goes through more steps):
1) bundleName_specifiedLanguage.properties
2) bundleName_defaultLanguage.properties
3) bundleName.properties
In addition to locale specific Bible names, JSword also needs English
Bible names which it uses as a fallback when comparing keys.
To get this, if the default locale is not already English, JSword
explicitly asks for the BibleNames bundle in the "en" locale; this may
not always work.
Consider the following scenarios when an attempt to get the English
Bible names is made:
a) JSword running in a French locale
1) Java looks for BibleNames_en.properties - does not exist
2) Java looks for BibleNames_fr.properties - exists
BibleNames_fr.properties is now returned as the englishBibleNames bundle.
b) JSword running in a Japanese locale
1) Java looks for BibleNames_en.properties - does not exist
2) Java looks for BibleNames_ja.properties - does not exist
3) Java looks for BibleNames.properties - exists
BibleNames.properties is now returned as the englishBibleNames bundle,
in this case, it is correct.
So you can see that englishBibleNames will contain English names only
when there is no localization properties file present corresponding to
that locale's default language (English is one of these languages, just
so happens that the default language is English as well). In the twenty
odd languages for which localized BibleNames exist, englishBibleNames
will be the same bundle as the localized Bundle, making it completely
useless as a fallback.
I have seen references in Books fail because they used English names
(exo instead of exod) instead of OSIS names in their osisRef elements. I
assume this is a common issue (hence the fallback code to English).
Normally, the englishName lookup would have saved the day, but this was
a German system and the englishName was the same as the German name. To
replicate, in BD, set Application Preferences > Language to German. Then
load a gen book like "International Standard Bible Encyclopedia". Select
the entry on Aaron and attempt to load the link to Ex 6:20 - nothing
happens, but this works in English. The link uses exo instead of exod.
Suggested fix:
1) Create a copy of the BibleNames.properties file, name it
BibleNames_en.properties.
or
2) Change the code which loads the englishBibleNames bundle to
explicitly load BibleNames.properties (I could not figure out how to use
ResourceBundle to *explicitly* load BibleNames.properties, does anyone
know?)
Given the fact that this property file is not going to be changing at
all, a copy won't hurt; I prefer the first option.
Thoughts?
Brian.
More information about the jsword-devel
mailing list