[jsword-devel] BibleInfo.properties and fallback

DM Smith dmsmith555 at yahoo.com
Sat Sep 30 16:14:03 MST 2006


Thanks for the info. I appreciate it.

Since you don't know how our mechanism works:

We have two different mechanisms that we use for looking up book  
names. One is the population of tables, using Java's built-in locale  
sensitive ResourceBundles. The other is the actual lookup against  
those tables.

Locale mechanism:
We use the Java ResourceBundle mechanism to do read the tables for  
the core mechanism. For any key of a resource in a resource bundle,  
the key is first looked up in a language and country ResourceBundle,  
if present. If the key is not found there (perhaps because the file  
didn't exist), the lookup then is against a ResourceBundle for just  
the language. And if the lookup fails then it grabs the default.,  
which is English.

We also have a property file of OSIS book names. This is not  
internationalized. So in that sense we have "English" defaults.

Using these we populate various lists (described below).

We use the list of full names and short names also as a display  
mechanism, where a user can choose to display books by long name or  
short name. And they can specify whether they appear in Title Case,  
lower case or UPPER CASE. We also allow the user to specify whether  
we preserve what they type in or whether we replace it with the full  
or short name of the book that we match.

Core mechanism:
We have lists of full book names, short names, osis name and then  
common alternatives (which also contains typical abbreviations).  The  
lookup is first against osis names as an exact match, then with with  
the first space removed. We look at osis names first because most  
lookups are programmatic and this shortens the lookup.

We then do case insensitive exact matches against short book names,  
then alternate names. We find abbreviated names to be more common  
than full names.

Then we look for shortest prefix , first looking at the full book  
name and then the short book name. The latter is only needed when the  
short book name is not a prefix of the full name.

Finally, we look for the shortest prefix, matching against alternate  

So our prioritization is fixed by book order.

-- DM

On Sep 30, 2006, at 2:09 PM, Troy A. Griffitts wrote:

> Just a note about how we do this in the C++ libs.
> We have 2 sections:
> 1) translation from the Long English name to the Long Locale Name
> 2) a set of prioritized abbreviations, combining English and the  
> locale.
> (1) is obvious.
> (2) takes a little more thought.  For example, consider, below, in
> Espanol: JOHN, JUAN, and a few other 'J' Book names.  In English,  
> as you
> type, 'J' we prefer John above other Books, then 'U' would  
> normally, in
> English, take you to Judges (it's bigger than Jude and odds are better
> you meant Judges), but since we have control over precedence, since
> we've decided to prefer John (or Juan) above Judges, we can add: JU=43
> to our list below.  You might be able to get away with this by always
> combining English into your Locale, but I would bet that sometimes  
> there
> are English entries (e.g., J=43) that will give odd precedence to  
> books,
> as their names diverge from the English.  Though I have no idea how
> JSword works with locales; just thought I'd give a little  
> background how
> we do things in C++-land.
> J=43
> JN=43
> JOHN=43
> JON=32
> JONAH=32
> JONÁS=32
> JUAN=43
> JUD=7
> JUDAS=65
> JUDE=65
> JUE=7
> Manfred Bergmann wrote:
>> I would prefer the second way.
>> If there is no property file for the current locale, te default
>> (english) locale will be used anyway.
>> If it is there, the book name key will first be tested against the
>> current locale, if it does not fit, the english or the default locale
>> is used.
>> Best regards,
>> Manfred
>> Am 30.09.2006 um 13:02 schrieb DM Smith:
>>> To have English as a fallback, we need to do one of two things:
>>>     1) the BibleInfo_de.properties is augmented with English
>>>     2) we create a mechanism to have English read in separately  
>>> and also
>>> used.
>>> The former is the easiest wrt software. The latter is a bit harder,
>>> but represents an easier path for translators. Perhaps there is
>>> another option that I am missing.
>>> In Him,
>>>     DM
>>> On Sep 30, 2006, at 5:06 AM, Manfred Bergmann wrote:
>>>> Hi all.
>>>> DM, you added the german translation for BibleInfo.
>>>> With this only german Bible book names are known, AFAIK.
>>>> It would however be very nice to have english (for every other
>>>> language) as fallback, means that for every other translation at
>>>> least english is also known so the user can type either english  
>>>> book
>>>> names or his native language book names.
>>>> I have gotten used to english book names and stuff and I would not
>>>> miss it even though the application itself may be in german.
>>>> How can this be accomplished?
>>>> Best regards,
>>>> Manfred
>>>> ___________________________________________________________
>>>> Telefonate ohne weitere Kosten vom PC zum PC: http://
>>>> messenger.yahoo.de
>>>> _______________________________________________
>>>> jsword-devel mailing list
>>>> jsword-devel at crosswire.org
>>>> http://www.crosswire.org/mailman/listinfo/jsword-devel
>>> _______________________________________________
>>> jsword-devel mailing list
>>> jsword-devel at crosswire.org
>>> http://www.crosswire.org/mailman/listinfo/jsword-devel
>> ___________________________________________________________Der frühe
>> Vogel fängt den Wurm. Hier gelangen Sie zum neuen Yahoo! Mail:
>> http://mail.yahoo.de
>> --------------------------------------------------------------------- 
>> ---
>> _______________________________________________
>> jsword-devel mailing list
>> jsword-devel at crosswire.org
>> http://www.crosswire.org/mailman/listinfo/jsword-devel
> _______________________________________________
> jsword-devel mailing list
> jsword-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/jsword-devel

More information about the jsword-devel mailing list