Closed juanmiguelbesada closed 10 years ago
I have noticed the same behavior, so at the moment I don't use the web profiler
the problem actually does not come from the Web profiler itself, but because of the way we are managing the locale in Silex.
The Web profiler toolbar registration triggers the creation of the Twig instance, which registers the translator extension, which in turn creates the translator, which gets the locale from $app['locale']
. But at this point, the locale listener has not been trigered yet and so the locale is always en. Later on, when the locale listener changes the value of $app['locale']
, it's too late as the translator has already been created.
I'm closing this issue and I will create a new one on Silex about this issue.
should be fixed by fabpot/Silex#829
An example is worth a thousand words. Simple App (Silex Fat + SilexWebProfiler)
composer.json
web\index.php
Run:
Result, it works as spected.
Now uncoment this lines:
Run again:
It don't works at all, always use 'en' as locale