Skip to content

[Translator] Does not make use of request.locale anymore? #12988

@rvanlaak

Description

@rvanlaak

When upgrading from 2.5.8 to 2.6.1 the Translator component does not seem to be compatible with the "sticky locale" from the cookbook article.

The difference with my implementation is that I use services.yml in order to make the call, instead of implementing the EventSubscriberInterface.

services:
    acme.locale_listener:
        class: Acme\DemoBundle\EventListener\LocaleListener
        tags:
            - { name: kernel.event_listener, event: kernel.request, method: setLocaleForUnauthenticatedUser }

Injecting the Translator into the Listener and setting the locale manually does solve the problem. Re-adding the code that is removed by this commit of Sept 26 also does result in the expected behaviour again.

Has the behaviour changed, or is this behaviour wanted?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions