caleb531 / youversion-suggest-alfred

An Alfred workflow for searching the YouVersion Bible quickly and easily
MIT License
57 stars 1 forks source link

Customize abbreviations for Bible books? #10

Closed micaelgrenholm closed 4 years ago

micaelgrenholm commented 4 years ago

Hi Caleb! Great workflow, thank you so much!

I'm a Swedish pastor and so I was glad to find that I could set Swedish as my preferred language. However, I discovered that I can't write for example yvfilter 1 tim 2:4, then I simply get "no results".

Skärmavbild 2020-01-05 kl  21 37 52

What I need to do is to write "Första Tim 2:4". "Första" is Swedish for "first". What's happening is simply that the script treats "Första" as a name that can't be replaced by "1". The same is true if I wish to search for 2 Kings or 2 Corinthians, then I have to type in "Andra" instead of 2.

This obviously gets a bit tedious, since so many Bible books start with numbers! :) Now, I'm wondering if there is a way for me to customize the abbreviations used by the workflow myself, or should I simply wait for an update from you if you have time looking at this?

Thanks and blessings, Micael

caleb531 commented 4 years ago

Hi @micaelgrenholm,

Firstly, thank you for your kind words about YouVersion Suggest! I am so happy it can be useful for your pastoring. Now to answer your question:

The Bible book names for the various languages are sourced directly from the YouVersion site, so the reason you see "Första Tim..." instead of "1 Tim..." is because that's exactly what's written on the YouVersion site. See: https://www.bible.com/bible/154/1TI.1

Fortunately, all of that Bible data is prefetched and stored in the workflow itself, and therefore it is something you can easily modify to suit your needs. Here are the steps:

  1. In the Workflows pane in Alfred Preferences, right-click the "YouVersion Suggest" workflow and choose "Open in Finder" from the menu

  2. In the Finder window that opens, navigate into the yvs > data > bible subdirectory. You should see a list of files named like bible-*.json; the one for Swedish is bible-swe.json

  3. Open that file in a text editor (TextEdit should work); you'll see a list of all Bible books, beginning with Genesis. You are free to modify any of these book names to your heart's content, and the workflow should continue to work normally once you save your file changes.

Please see my attached screenshots, and let me know if I can clarify anything.

1-file-path 2-file-contents

Caleb

micaelgrenholm commented 4 years ago

Dear Caleb,

Thank you for the easy-to-follow guideline! This works perfectly, and will probably help me save hours in the future. I will recommend your workflow to other pastors and Bible users I know.

Blessings!