So far, I have been able to install this module and edit the .inc file to default to the Portuguese version of the Bible. My question is, how can I edit the books of the Bible to reflect the Portuguese spelling? Specifically, with regards to accent marks and such. For example, in Portuguese, Genesis is written Gênesis. When I edited the $book_regex to the Portuguese spelling, it broke the filter.
I say that in some of the code, the is a ? mark in the name. What exactly does this do? Is it some sort of wild card?

I am new to PHP, so forgive me if there is an obvious answer.
Jason

Comments

beeradb’s picture

My guess is that this issue is caused by the usage of preg_replace on line 62 of scripturefilter.inc. preg_replace is not multibyte compatible, and therefor doesn't gracefully handle some unicode characters. Try changing the preg_replace on line 62 of scripturefilter.inc to a mb_ereg_replace() function call, which plays nice with multibyte characters.

If this works for you I'm sure the original author would love it if you submit a patch which fixes the issue.

jasondgardner’s picture

Thank you very much.
I'll try that out and if/when I can get it working... I'll be sure to submit the patch.
Merry Christmas.

jamesoakley’s picture

Title: Using non-English characters » Supporting Bible books / translations other than English ones
Version: 6.x-1.0 » master

This is actually part of a much bigger issue.

The publicly available version of this module cannot match the names of Bible books and the abbreviations for those names in every language at once. There are already a few issue related to "false positives" (when the module thinks it's found a Bible reference when there isn't one). If you say that anything that would be a Bible reference in English, French, Spanish, German or Portuguese is to be matched, we'd start to get far more false positives.

So I'd say there is a bit limitation on this module at present - only English Bible references are detected, and only English Bible translations are linked to.

There's more to overcoming that limitation than just tweaking regular expression pattern matching so it can handle full unicode. I'd say that we first need to make the "language" that the filter is operating in another setting. The filter then detects links only in the language for which it is set. When that change is made, you are right: We need to make sure everything is unicode compliant, as there will be languages for which we need that.

So: I'm changing the issue title to this bigger issue, because changing regular expressions to support unicode makes sense within, and only within, that bigger context.

As to non European languages - some will be solved in this fashion, and some will be a much bigger matter - all depending on whether they use the same notation to divide volumes, books, chapters and verses as English. Implementing language support for languages that do denote Bible references in the form "1 Chr 1:1-2:6" is the first step, though, for sure.

jamesoakley’s picture

Category: support » feature
Status: Active » Postponed

Postponing this issue.

This is a feature request. The highest priority feature for Scripture Filter is preparing a Drupal 8 version. Once a Drupal 8 version is ready, I can then turn my attention to working on improvements. Those would be developed for Drupal 8 first, and then backported.

jamesoakley’s picture

Version: master » 2.0.x-dev
Issue summary: View changes
Status: Postponed » Active

A version of the module is now available for Drupal 8 and Drupal 9, so I'm marking this issue as Active.