[sword-devel] localized booknames - VerseMgr

Manfred Bergmann bergmannmd at web.de
Thu Feb 19 06:28:24 MST 2009


Thanks Troy.

I wasn't aware of the translate() method.


Am 19.02.2009 um 13:08 schrieb Troy A. Griffitts:

> 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