Skip to content

Commit

Permalink
Coerce empty $locale string to null to fix regression #135
Browse files Browse the repository at this point in the history
Signed-off-by: George Steel <[email protected]>
  • Loading branch information
gsteel committed Sep 10, 2024
1 parent 0f7b0ff commit a71a848
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/Translator/Translator.php
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,7 @@ public function getPluginManager()
*/
public function translate($message, $textDomain = 'default', $locale = null)
{
$locale = $locale === '' ? null : $locale;
$locale = $locale ?? $this->getLocale();
$translation = $this->getTranslatedMessage($message, $locale, $textDomain);

Expand Down

0 comments on commit a71a848

Please sign in to comment.