services:
    oro_frontend_localization.manager.user_localization:
        class: Oro\Bundle\FrontendLocalizationBundle\Manager\UserLocalizationManager
        public: true
        arguments:
            - '@request_stack'
            - '@security.token_storage'
            - '@doctrine'
            - '@oro_config.manager'
            - '@oro_website.manager'
            - '@oro_locale.manager.localization'

    Oro\Bundle\FrontendLocalizationBundle\Manager\UserLocalizationManager:
        alias: oro_frontend_localization.manager.user_localization

    oro_frontend_localization.extension.current_localization.request:
        class: Oro\Bundle\FrontendLocalizationBundle\Extension\RequestCurrentLocalizationExtension
        arguments:
            - '@request_stack'
            - '@oro_locale.manager.localization'
        tags:
            - { name: oro_locale.extension.current_localization }

    oro_frontend_localization.extension.current_localization:
        class: Oro\Bundle\FrontendLocalizationBundle\Extension\CurrentLocalizationExtension
        arguments:
            - '@security.token_storage'
            - '@oro_frontend_localization.manager.user_localization'
        tags:
            - { name: oro_locale.extension.current_localization, priority: -10 }

    oro_frontend_localization.acl.voter.localization:
        class: Oro\Bundle\FrontendLocalizationBundle\Acl\Voter\LocalizationVoter
        arguments:
            - '@oro_entity.doctrine_helper'
        calls:
            - [setClassName, ['Oro\Bundle\LocaleBundle\Entity\Localization']]
        tags:
            - { name: security.voter }

    oro_locale.formatter.date_time.decorator:
        class: Oro\Bundle\FrontendLocalizationBundle\Formatter\DateTimeFormatterDecorator
        decorates: oro_locale.formatter.date_time
        arguments:
            - '@.inner'
            - '@oro_frontend.request.frontend_helper'

    oro_locale.helper.localized_slug_redirect:
        class: 'Oro\Bundle\FrontendLocalizationBundle\Helper\LocalizedSlugRedirectHelper'
        arguments:
            - '@oro_redirect.provider.slug_source_entity_provider_registry'
            - '@doctrine'
            - '@oro_redirect.generator.canonical_url'
            - '@oro_website.manager'
            - '@oro_redirect.routing.router'

    Oro\Bundle\FrontendLocalizationBundle\Helper\LocalizedSlugRedirectHelper:
        alias: oro_locale.helper.localized_slug_redirect

    oro_frontend_localization.extension.slug_detect_localization:
        class: Oro\Bundle\FrontendLocalizationBundle\Extension\SlugDetectLocalizationExtension
        arguments:
            - '@request_stack'
            - '@oro_frontend_localization.manager.user_localization'
            - '@doctrine'
        tags:
            - { name: oro_locale.extension.current_localization, priority: -5 }
