diff --git a/src/LiturgyOfTheDay.php b/src/LiturgyOfTheDay.php index b9a3bdf..245515a 100644 --- a/src/LiturgyOfTheDay.php +++ b/src/LiturgyOfTheDay.php @@ -23,7 +23,9 @@ class LiturgyOfTheDay private array $LitCalFeed = []; private \IntlDateFormatter $monthDayFmt; private array $queryParams = []; - //private string $logFile = 'debug.log'; + private const PHONETIC_PRONUNCATION_MAPPING = [ + '/Blessed( Virgin Mary)/' => 'Blessed $1', + ]; public function __construct() { @@ -203,6 +205,13 @@ private function prepareMainText(Festivity $festivity, int $idx): string } } + //Fix some phonetic pronunciations + foreach (LiturgyOfTheDay::PHONETIC_PRONUNCATION_MAPPING as $key => $value) { + if (preg_match("/$key/", $festivity->name) === 1) { + $festivity->name = str_replace($key, $value, $festivity->name); + } + } + if ($festivity->grade === LitGrade::WEEKDAY) { $mainText = _("Today is") . " " . $festivity->name . "."; } else {