Skip to content

Commit

Permalink
only retrieve names for existing i18n keys
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnRDOrazio committed Nov 28, 2024
1 parent 8c9a650 commit 8a4b423
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Paths/RegionalData.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,9 @@ private function getRegionalCalendar(): void
if (file_exists($CalendarDataI18nFile)) {
$localeData = json_decode(file_get_contents($CalendarDataI18nFile));
foreach ($CalendarData->litcal as $idx => $el) {
$CalendarData->litcal[$idx]->festivity->name = $localeData->{$CalendarData->litcal[$idx]->festivity->event_key};
if (property_exists($localeData, $CalendarData->litcal[$idx]->festivity->event_key)) {
$CalendarData->litcal[$idx]->festivity->name = $localeData->{$CalendarData->litcal[$idx]->festivity->event_key};
}
}
} else {
self::produceErrorResponse(StatusCode::NOT_FOUND, "file $CalendarDataI18nFile does not exist");
Expand Down

0 comments on commit 8a4b423

Please sign in to comment.