<?xml version="1.0" encoding="UTF-8"?>

<!--

 This file is part of the Sylius package.

 (c) Sylius Sp. z o.o.

 For the full copyright and license information, please view the LICENSE
 file that was distributed with this source code.

-->

<container
    xmlns="http://symfony.com/schema/dic/services"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"
>
    <services>
        <service id="sylius_shop.locale_switcher" class="Sylius\Bundle\ShopBundle\Locale\UrlBasedLocaleSwitcher">
            <argument type="service" id="router" />
        </service>

        <service id="sylius_shop.listener.non_channel_locale" class="Sylius\Bundle\ShopBundle\EventListener\NonChannelLocaleListener" public="true">
            <argument type="service" id="router" />
            <argument type="service" id="sylius.provider.locale" />
            <argument type="service" id="security.firewall.map" />
            <argument type="collection">
                <argument type="string">%sylius_shop.firewall_context_name%</argument>
            </argument>
            <tag name="kernel.event_listener" event="kernel.request" method="restrictRequestLocale" priority="10"/>
        </service>
    </services>
</container>
