Skip to content

locale listener doc ./. example discrepancy #9164

Closed
@kaiwa

Description

@kaiwa

https://symfony.com/doc/master/translation/locale.html

The custom listener must be called before LocaleListener, which initializes the locale based on the current request. To do so, set your listener priority to a higher value than LocaleListener priority (which you can obtain running the debug:event kernel.request command).

And then in the linked example:

https://symfony.com/doc/master/session/locale_sticky_session.html

    public static function getSubscribedEvents()
    {
        return array(
            // must be registered after the default Locale listener
            KernelEvents::REQUEST => array(array('onKernelRequest', 15)),
        );
    }

Documentation says (in bold) the custom listener must be registered before the framework listener, the inline doc in the example says after, which is exactly the opposite.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: Needs ReviewactionableClear and specific issues ready for anyone to take them.buggood first issueIdeal for your first contribution! (some Symfony experience may be required)hasPRA Pull Request has already been submitted for this issue.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions