Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
Update LoggingTranslator to log the change of a locale#31242
New issue
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
| { | ||
| $prev =$this->translator->getLocale(); | ||
| $this->translator->setLocale($locale); | ||
| $this->logger->debug('Translator has changed the locale.', ['previous' =>$prev,'new' =>$locale]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
+1 it can be usefull in dev
previous/next or old/new, here you use one of both
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
It'd suggest putting the locale in the message, e.g.:The locale of the translator has changed from "%s" to "%s".
fabpot commentedApr 27, 2019
Thank you@gmponos. |
… (gmponos)This PR was squashed before being merged into the 4.3-dev branch (closes#31242).Discussion----------Update LoggingTranslator to log the change of a locale| Q | A| ------------- | ---| Branch? | master| Bug fix? | no| New feature? | yes| BC breaks? | no| Deprecations? | no| Tests pass? | yes| License | MITI would like to see inside my logs that the translator changed the locale. I've had a case that I spent significant amount of time trying to debug it.Commits-------20380f9 Update LoggingTranslator to log the change of a locale
I would like to see inside my logs that the translator changed the locale. I've had a case that I spent significant amount of time trying to debug it.