In one SAB Bible project, the users are not always familiar with the book names in the local language, but might know them better in French. So we had the clever idea to put the French book name in parentheses after the book name in the local language. So for example, for the book of Joel, on the Book tab, the Book Name field says “Yuwiil (Joël)”. This appears fine in the book list in the app, but now all of our cross references in footnotes don’t contain active links. I’m assuming that’s because the reference only contains the local language book name, so that doesn’t match with the book name in the book list (which includes the French) anymore? This is an example cross reference:
\fr 2:21 \ft Al-kalaam da talgooh fi \+xt Yuwiil 2:28-32\+xt*.\f*
Is there any way to change the way a book name appears in the book list, but so that it will still work using the original name in the cross references?
Amazing what you can find when you poke around a little bit… On the far right of the “Book Name” field there is a “More…” button. When you click on it, it asks, “Specify additional forms of the book name, to be used when parsing references.” Exactly what I needed! So I added “Yuwiil” in one of the fields, and now the references for that book have active links.
I wonder, when you first build the app, would it fill in the \toc2 or \toc3 values from the book if they were different than the default book name? That might be a helpful feature…
This is how the .appDef file looks after I add this additional book name:
If you wanted to extract that part of the name before the parentheses and add it into the XML structure automatically, here is a Regular Expression that can do that for you:
This searches for the
<name> tag, and captures the text before the parentheses. Since the
<abbrev> tag always follows, we capture the spacing at the beginning of that line (to replicate that spacing on the lines we will produce, so there is an identical indent), then we produce the
<additional-names> tag with only the local language form of the book name.
Note that if you use this expression to replace all in your .appDef file, it will also produce additional-names for your introductions and any other supplemental books. So you may want to manually delete the additional-names block for those books (since they won’t be the destination for any cross references).
One additional note… The SFM for the cross reference inside the footnote given in the original post is
\+xt and not just
\xt. I believe this is basically required by Paratext because the cross reference SFM is embedded within another SFM (the footnote). However SAB seems to expect just
\xt. We take care of this with a simple Changes rule that we give the name “Remove xref embedding”. It simply makes this replacement:
Note that the backslash in the Find expression is not a real backslash, but is just the escape character so that you can match the
+ sign. So you are finding
+xt and replacing it with
xt. That seems to work for us.