[sword-devel] How to get translated book abbreviations with LocaleMgr?

Tobias Klein contact at tklein.info
Sun May 17 23:27:32 MST 2020


On 5/15/20 8:22 PM, Troy A. Griffitts wrote:
> The other sections (sections besides [Text] in SWORD's locale files 
> are not specifically for directly translation.  They are used by 
> SWORD's verse parser VerseKey translation, etc.

Let me explain my actual use case.

After doing a module search I'm generating a bar chart that visualizes 
search results per bible book. It looks like this at the moment:
https://paste.pics/073e805fc1a74db1e7899aefaf838e86

In that bar chart I'm using the book abbreviations as labels on the 
x-axis of the chart. I'm simply using the abbreviations, because the 
full book names would take up too much vertical screen space in this 
particular case.

That's why I was asking for a direct method for translating the Abbrev. 
strings, since I don't need the abbreviations for individual verses 
(then the VerseKey based approach would totally make sense), but in this 
case I simply need to generate an array with all the book names 
(abbreviations) to use as labels for the x-axis of the chart.)

I can work with the existing API, but for this particular use case it's 
certainly a bit odd (from an object-oriented standpoint), because I'm 
not dealing with individual verses in this case.

Best regards,
Tobias




More information about the sword-devel mailing list