[sword-devel] localized booknames - VerseMgr

Troy A. Griffitts scribe at crosswire.org
Thu Feb 19 06:12:37 MST 2009


Sorry, so briefly, if you have the VerseMgr::Book object, you can get 
the translated book name with:

LocaleMgr::getSystemLocaleMgr->translate(book->getLongName());



Troy A. Griffitts wrote:
> 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)
> 
>     -Troy.
> 
> 
> 
> 
> 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
> 
> 
> _______________________________________________
> 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