We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Passing empty string used to be the same as passing null as locale to \Laminas\I18n\Translator\Translator::translate() but the behavior changed.
\Laminas\I18n\Translator\Translator::translate()
@@ -345,7 +345,7 @@ public function getPluginManager() */ public function translate($message, $textDomain = 'default', $locale = null) { - $locale = $locale ?: $this->getLocale(); + $locale = $locale ?? $this->getLocale(); $translation = $this->getTranslatedMessage($message, $locale, $textDomain);
https://github.com/laminas/laminas-i18n/pull/117/files#diff-617dd26fad700da3ee06fad2afafa9652a82a157416b914efbada1998c38d478L348
\Laminas\I18n\Translator\Translator::translate() returns translated message using default locale when empty string is passed as locale
\Laminas\I18n\Translator\Translator::translate() returns untranslated message when empty string is passed as locale.
pass empty string as locale to \Laminas\I18n\Translator\Translator::translate()
The text was updated successfully, but these errors were encountered:
@gsteel Can you take a look at this? Thanks in advance! 👍🏻
Sorry, something went wrong.
Coerce empty $locale string to null to fix regression laminas#135
$locale
null
a71a848
Signed-off-by: George Steel <[email protected]>
084ec1a
Closed via #136
gsteel
Successfully merging a pull request may close this issue.
BC Break Report
Summary
Passing empty string used to be the same as passing null as locale to
\Laminas\I18n\Translator\Translator::translate()
but the behavior changed.https://github.com/laminas/laminas-i18n/pull/117/files#diff-617dd26fad700da3ee06fad2afafa9652a82a157416b914efbada1998c38d478L348
Previous behavior
\Laminas\I18n\Translator\Translator::translate()
returns translated message using default locale when empty string is passed as localeCurrent behavior
\Laminas\I18n\Translator\Translator::translate()
returns untranslated message when empty string is passed as locale.How to reproduce
pass empty string as locale to
\Laminas\I18n\Translator\Translator::translate()
The text was updated successfully, but these errors were encountered: