Skip to content

Commit

Permalink
laminas#7: Missed returns
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin Hamilton <[email protected]>
  • Loading branch information
TotalWipeOut committed May 16, 2024
1 parent 7d257af commit f07eef4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Translator/Translator.php
Original file line number Diff line number Diff line change
Expand Up @@ -358,14 +358,14 @@ public function translate($message, $textDomain = 'default', $locale = null)
$translation = $this->getTranslatedMessage($message, $locale, $textDomain);

if ($translation !== null && $translation !== '') {
return $translation;
return $this->compileMessage($translation, $placeholders, $locale);
}

if (
null !== ($fallbackLocale = $this->getFallbackLocale())
&& $locale !== $fallbackLocale
) {
return $this->translate($message, $textDomain, $fallbackLocale);
return $this->translate($message, $placeholders ?: $textDomain, $fallbackLocale);
}

return $this->compileMessage($message, $placeholders, $locale);
Expand Down

0 comments on commit f07eef4

Please sign in to comment.