parameters:

services:

  # Custom data_collector to use our own template
  happyr.translation.data_collector:
    class: Symfony\Component\Translation\DataCollector\TranslationDataCollector
    arguments: [ '@?translator.data_collector' ]
    tags:
      - { name: 'data_collector', template: "@HappyrTranslation/Profiler/translation", id: "translation", priority: 200 }

  happyr.translation.service.blackhole:
    class: Happyr\TranslationBundle\Service\Blackhole

  happyr.translation.service.filesystem:
    class: Happyr\TranslationBundle\Service\Filesystem
    arguments: ['@happyr.translation.filesystem']

  happyr.translation.filesystem:
    class: Happyr\TranslationBundle\Translation\FilesystemUpdater
    arguments:
      - '@happyr.translation.loader'
      - '@happyr.translation.dumper'
      - ~
      - ~
      - ~
    tags:
      - { name: kernel.event_listener, event: kernel.terminate, method: onTerminate, priority: -20 }
      - { name: kernel.event_listener, event: console.terminate, method: onTerminate, priority: -20 }

  happyr.translation.service.loco:
    class: Happyr\TranslationBundle\Service\Loco
    arguments:
      - '@happyr.translation.request_manager'
      - '@happyr.translation.filesystem'
      - '@translator'
      - ~

  happyr.translation.request_manager:
    class: Happyr\TranslationBundle\Http\RequestManager
    arguments: [~, ~]
    public: false
