[sword-devel] lost books (testaments) when in Turkish locale

Karl Kleinpaste karl at kleinpaste.org
Sun Mar 14 07:07:22 MST 2010

I'm looking at a Xiphos bug report which notes that, when operating in
Turkish locale (LC_ALL=tr_TR LANG=tr), the Old Testament appears to be
simply missing, no matter the Bible module in use.  I can reproduce the
bad effect.

Picking on a perfectly ordinary 2-testament Bible module (my NET), I try
to navigate off the book pulldown, which takes me eventually into our
backend code which wants to construct the menu of available books.  We
verify the existence of each testament individually before adding books
to the menu.  Eventually, this comes down to this bit of navel-gazing

		*module = sword::TOP; //position to first entry
		sword::VerseKey key( module->KeyText() );
		if (key.Testament() == 1) { // OT && NT
			ot = 1;
		} else if (key.Testament() == 2) { //no OT
			ot = 0;

		*module = sword::BOTTOM;
		key = module->KeyText();
		if (key.Testament() == 1) { // only OT, no NT
			nt = 0;
		} else if (key.Testament() == 2) { //has NT
			nt = 1;

Then we return a result based on the testament whose existence is

The odd result I'm seeing is that the result of key.Testament() is
neither 1 nor 2.  In English locale, this returns proper values, and I
get the full menu.  There is no Turkish locale specification in
/usr/share/sword/locales.d, so I don't expect names to be translated,
but should locale-insensitive checks about the existence of a testament

More information about the sword-devel mailing list