Skip to content

Commit

Permalink
try fixing phonetic pronunciation of 'Blessed'
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnRDOrazio committed Oct 5, 2024
1 parent 16e4ab5 commit 814eba0
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/LiturgyOfTheDay.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)/' => '<speak><phoneme alphabet="ipa" ph="ˈblɛsɪd">Blessed</phoneme></speak> $1',
];

public function __construct()
{
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 814eba0

Please sign in to comment.