Skip to content

Commit

Permalink
DocGen patch.
Browse files Browse the repository at this point in the history
  • Loading branch information
Maikuolan committed Jun 14, 2023
1 parent 863a2f2 commit da9e83d
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion scripts/DocGen.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,28 @@
}
$Out = [];
foreach ($References as $Reference) {
$Try = '';
if (isset($L10N->Data[$Reference])) {
$Reference = $L10N->Data[$Reference];
$Try = $L10N->Data[$Reference];
} elseif (is_array($L10N->Fallback)) {
if (isset($L10N->Fallback[$Reference])) {
$Try = $L10N->Fallback[$Reference];
}
} elseif ($L10N->Fallback instanceof \Maikuolan\Common\L10N) {
if (isset($L10N->Fallback->Data[$Reference])) {
$Try = $L10N->Fallback->Data[$Reference];
} elseif (is_array($L10N->Fallback->Fallback) && isset($L10N->Fallback->Fallback[$Reference])) {
$Try = $L10N->Fallback->Fallback[$Reference];
}
}
if ($Try === '') {
if (($SPos = strpos($Reference, ' ')) !== '') {
$Try = (($TryFrom = $L10N->getString(substr($Reference, 0, $SPos))) !== '' && strpos($TryFrom, '%s') !== '') ? sprintf($TryFrom, substr($Reference, $SPos + 1)) : $Reference;
} else {
$Try = $Reference;
}
}
$Reference = $Try;
if (!is_array($Reference)) {
$Reference = [$Reference];
}
Expand Down

0 comments on commit da9e83d

Please sign in to comment.