Skip to content

Commit

Permalink
set message if english used in partial translations
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnRDOrazio committed Jun 23, 2024
1 parent 921f7f9 commit 96ba909
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/AnniversaryCalculator.php
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ private function readData()
count($results),
$dataFile
);
$englishResultsUsed = false;
foreach ($lclData as $label => $lclRow) {
list( $TAG, $IDX ) = explode("_", $label);
// if we wanted to check for empty strings, and try to merge the English equivalent,
Expand All @@ -289,7 +290,9 @@ private function readData()
&& $lclDataEnglish !== null
&& property_exists($lclDataEnglish, $label)
&& property_exists($lclDataEnglish->$label, $rowLabel)
&& '' !== $lclDataEnglish->$label->$rowLabel
) {
$englishResultsUsed = true;
$lclRow->$rowLabel = $lclDataEnglish->$label->$rowLabel;
}
}
Expand Down Expand Up @@ -332,6 +335,9 @@ private function readData()
_("%d data rows calculated"),
count($this->RESPONSE->LitEvents)
);
if ($englishResultsUsed) {
$this->RESPONSE->Messages[] = "English results were used for this incomplete translation";
}
} else {
$this->RESPONSE->Messages[] = sprintf(
/**translators: filename */
Expand Down

0 comments on commit 96ba909

Please sign in to comment.