[sword-devel] localized booknames - VerseMgr

Troy A. Griffitts scribe at crosswire.org
Thu Feb 19 06:08:00 MST 2009

VerseMgr holds the authoritative "Key" book names we use in our locales 
(these are the English names) so you can just pass these to the 
translate method of any locale, e.g.

VerseMgr *verseMgr = VerseMgr::getSystemVerseMgr();
LocaleMgr *localeMgr = LocaleMgr::getSystemLocaleMgr();

VerseMgr::System *kjvVersification
	= verseMgr->getVersificationSystem("KJV");

// 0 = Genesis
SWBuf bookNameInEnglish = kjvVersification->getBook(0)->getLongName();

// you can translate using the 'current' locale
SWBuf bookNameInCurrentLocale = localeMgr->translate(bookNameInEnglish);

// or you can grab a specific locale from the mgr and translate using it
SWLocale *deLocale = localeMgr->getLocale("de");

SWBuf bookNameInGerman = deLocale->translate(bookNameInEnglish);

Hope this helps (and has no syntax errors)


Manfred Bergmann wrote:
> Hi there (probably Troy :).
> I'm using VerseMgr to cache a list of Books (VerseMgr::Book) in MacSword.
> getBookName() only returns the english book name.
> If there a way to retrieve the localized book name without using VerseKey?
> Regards,
> Manfred
> _______________________________________________
> sword-devel mailing list: sword-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/sword-devel
> Instructions to unsubscribe/change your settings at above page

More information about the sword-devel mailing list