services:
    qba_language.form.language:
         class: QbaBit\LanguageBundle\Form\QbLanguageType
         tags:
            - name: "form.type"
         arguments: ["@service_container"]
    qba_language.form.language_ruote:
         class: QbaBit\LanguageBundle\Form\QbLanguageRouteType
         tags:
            - name: "form.type"
         arguments: ["@service_container"]
    qba_language.form.language_ruote_inner:
         class: QbaBit\LanguageBundle\Form\QbLanguageRouteInnerType
         tags:
            - name: "form.type"
         arguments: ["@service_container"]
    qba_language.services.language_utils:
         class: QbaBit\LanguageBundle\Services\QbLanguageUtils
         public: true
         arguments: ["@service_container"]
    gedmo.listener.translatable:
        class: Gedmo\Translatable\TranslatableListener
        tags:
            - { name: doctrine.event_subscriber, connection: default }
        calls:
            - [ setAnnotationReader, [ "@annotation_reader" ] ]
#            - [ setDefaultLocale, [ "%locale%" ] ]
#            - [ setTranslatableLocale, [ "en_US" ] ]
            - [ setTranslationFallback, [ false] ]
    doctrine.listener:
        class: QbaBit\LanguageBundle\EventListener\DoctrineTranslatorListener
        arguments: [ "@gedmo.listener.translatable","@service_container" ]
        tags:
            # translatable sets locale after router processing
            - { name: kernel.event_listener, event: kernel.request, method: onLateKernelRequest, priority: 15 }
    QbaBit\LanguageBundle\Loader\RoutingLoader:
        tags: [routing.loader]
        arguments: ["@service_container"]
    qbabit.language.annontation.slugtranslable:
        class: QbaBit\LanguageBundle\EventListener\SlugTranslableListener
        tags:
             - { name: doctrine.event_subscriber, connection: default }
        arguments:
            - "@annotation_reader"
            - "@service_container"