From 7a85d93759277a1d47327810ae97d5bd18224e63 Mon Sep 17 00:00:00 2001 From: "John R. D'Orazio" Date: Sun, 23 Jun 2024 00:03:05 +0200 Subject: [PATCH] uppercase values --- src/AnniversaryCalculator.php | 19 ++++++++++++++----- src/AnniversaryCalculator/LitEvent.php | 4 ++-- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/AnniversaryCalculator.php b/src/AnniversaryCalculator.php index 2592c816..873fb4f9 100644 --- a/src/AnniversaryCalculator.php +++ b/src/AnniversaryCalculator.php @@ -219,14 +219,23 @@ private function prepareL10N(): void $localeArray = [ $this->parameterData["LOCALE"] . '.utf8', $this->parameterData["LOCALE"] . '.UTF-8', + $this->parameterData["LOCALE"], $this->parameterData["BASE_LOCALE"] . '_' . strtoupper($this->parameterData["BASE_LOCALE"]) . '.utf8', $this->parameterData["BASE_LOCALE"] . '_' . strtoupper($this->parameterData["BASE_LOCALE"]) . '.UTF-8', - $this->parameterData["LOCALE"], - $this->parameterData["BASE_LOCALE"] . '_' . strtoupper($this->parameterData["BASE_LOCALE"]) + $this->parameterData["BASE_LOCALE"] . '_' . strtoupper($this->parameterData["BASE_LOCALE"]), + $this->parameterData["BASE_LOCALE"] . '.utf8', + $this->parameterData["BASE_LOCALE"] . '.UTF-8', + $this->parameterData["BASE_LOCALE"] ]; - setlocale(LC_ALL, $localeArray); - bindtextdomain("litcal", "i18n"); - textdomain("litcal"); + $locale = setlocale(LC_ALL, $localeArray); + $textdomainpath = bindtextdomain("litcal", "i18n"); + $textdomain = textdomain("litcal"); + $this->RESPONSE->Messages[] = sprintf( + _('PHP setlocale set to locale %1$s, text domain path set to %2$s, text domain set to %3$s'), + $locale ? $locale : 'false', + $textdomainpath, + $textdomain + ); } private function setReponseContentTypeHeader() diff --git a/src/AnniversaryCalculator/LitEvent.php b/src/AnniversaryCalculator/LitEvent.php index 733e260d..76b24ca2 100644 --- a/src/AnniversaryCalculator/LitEvent.php +++ b/src/AnniversaryCalculator/LitEvent.php @@ -101,14 +101,14 @@ public function __construct(array $rowData) $this->eventDay = $rowData["EVENT_DAY"]; $this->memorialMonth = $rowData["MEMORIAL_MONTH"]; $this->memorialDay = $rowData["MEMORIAL_DAY"]; - $this->calendar = $rowData["CALENDAR"]; + $this->calendar = $LitCalendar->isValid($rowData["CALENDAR"]) ? strtoupper($rowData["CALENDAR"]) : '???'; $this->calendarLcl = $LitCalendar->i18n($rowData["CALENDAR"]); $this->placeOfBirth = $rowData["PLACE_OF_BIRTH"]; $this->placeOfDeath = $rowData["PLACE_OF_DEATH"]; $this->placeOfBurial = $rowData["PLACE_OF_BURIAL"]; $this->mainShrine = $rowData["MAIN_SHRINE"]; $this->places = $rowData["PLACES"]; - $this->areaOfInterest = $rowData["AREA"] ? explode(",", $rowData["AREA"]) : []; + $this->areaOfInterest = $rowData["AREA"] ? array_map('strtoupper', explode(",", $rowData["AREA"])) : []; $this->areaOfInterestLcl = $rowData["AREA"] ? $AreaInterest->i18n(explode(",", $rowData["AREA"])) : []; $this->notes = $rowData["NOTES"]; $this->patronage = $rowData["PATRONAGE"];