parameters:
    kunstmaan_translator.menu.adaptor.class: 'Kunstmaan\TranslatorBundle\Service\Menu\TranslatorMenuAdaptor'
    kunstmaan_translator.service.exporter.csv.class: Kunstmaan\TranslatorBundle\Service\Command\Exporter\CSVFileExporter
    kunstmaan_translator.toolbar.collector.translator.class: Kunstmaan\TranslatorBundle\Toolbar\TranslatorDataCollector

services:
    kunstmaan_translator.menu.adaptor:
        class: '%kunstmaan_translator.menu.adaptor.class%'
        tags:
            -  { name: 'kunstmaan_admin.menu.adaptor' }

    kunstmaan_translator.service.abstract_command_handler:
        abstract: true
        class: 'Kunstmaan\TranslatorBundle\Service\Command\AbstractCommandHandler'
        calls:
            - [setManagedLocales, ['%kuma_translator.managed_locales%']]
            - [setKernel, ['@kernel']]

    kunstmaan_translator.service.importer.command_handler:
        parent: kunstmaan_translator.service.abstract_command_handler
        class: 'Kunstmaan\TranslatorBundle\Service\Command\Importer\ImportCommandHandler'
        calls:
            - [setTranslationFileExplorer, ['@kunstmaan_translator.service.file_explorer']]
            - [setImporter, ['@kunstmaan_translator.service.importer.importer']]
        public: true

    # TODO: needs to be refactored, should not need to be public
    kunstmaan_translator.service.exporter.command_handler:
        parent: kunstmaan_translator.service.abstract_command_handler
        class: 'Kunstmaan\TranslatorBundle\Service\Command\Exporter\ExportCommandHandler'
        calls:
            - [setTranslationRepository, ['@kunstmaan_translator.repository.translation']]
            - [setExporter, ['@kunstmaan_translator.service.exporter.exporter']]
        public: true

    kunstmaan_translator.service.exporter.exporter:
        class: 'Kunstmaan\TranslatorBundle\Service\Command\Exporter\Exporter'

    kunstmaan_translator.service.exporter.yaml:
        class: 'Kunstmaan\TranslatorBundle\Service\Command\Exporter\YamlFileExporter'
        tags:
            - { name: 'translation.exporter', alias: 'yml' }

    kunstmaan_translator.service.exporter.csv:
        class: "%kunstmaan_translator.service.exporter.csv.class%"
        tags:
            - { name: 'translation.exporter', alias: 'csv' }

    kunstmaan_translator.service.file_explorer:
        class: 'Kunstmaan\TranslatorBundle\Service\TranslationFileExplorer'
        calls:
            - [setFileFormats, ['%kuma_translator.file_formats%']]

    kunstmaan_translator.service.importer.importer:
        class: 'Kunstmaan\TranslatorBundle\Service\Command\Importer\Importer'
        arguments:
            - '@kunstmaan_translator.service.group_manager'
        public: true

    kunstmaan_translator.service.group_manager:
        class: 'Kunstmaan\TranslatorBundle\Service\TranslationGroupManager'
        arguments:
            - '@kunstmaan_translator.repository.translation'

    # TODO: needs to be refactored, should not need to be public
    kunstmaan_translator.service.translator.loader:
        class: Kunstmaan\TranslatorBundle\Service\Translator\Loader
        tags:
            - { name: 'translation.loader', alias: 'database' }
        calls:
            - [setTranslationRepository, ['@kunstmaan_translator.repository.translation']]
        public: true

    kunstmaan_translator.service.translator.resource_cacher:
        class: Kunstmaan\TranslatorBundle\Service\Translator\ResourceCacher
        calls:
            - [setDebug, ['%kuma_translator.debug%']]
            - [setCacheDir, ['%kuma_translator.cache_dir%']]
            - [setLogger, ['@logger']]
        public: true

    kunstmaan_translator.service.translator.cache_validator:
        class: Kunstmaan\TranslatorBundle\Service\Translator\CacheValidator
        calls:
            - [setCacheDir, ['%kuma_translator.cache_dir%']]
            - [setTranslationRepository, ['@kunstmaan_translator.repository.translation']]
        public: true

    kunstmaan_translator.service.translator.translator:
        class: Kunstmaan\TranslatorBundle\Service\Translator\Translator
        arguments:
            - '@service_container'
            - '@translator.formatter'
            - '%kernel.default_locale%'
            - {}
            - { cache_dir: '%kuma_translator.cache_dir%', debug: '%kuma_translator.debug%' }
            - '%kuma_translator.profiler%'
        calls:
            - [setTranslationRepository, ['@kunstmaan_translator.repository.translation']]
            - [setResourceCacher, ['@kunstmaan_translator.service.translator.resource_cacher']]
        tags: ['kernel.locale_aware']

    # TODO: needs to be refactored, should not need to be public
    kunstmaan_translator.service.migrations.migrations:
        class: 'Kunstmaan\TranslatorBundle\Service\Migrations\MigrationsService'
        calls:
            - [setTranslationRepository, ['@kunstmaan_translator.repository.translation']]
            - [setEntityManager, ['@doctrine.orm.default_entity_manager']]
        public: true

    kunstmaan_translator.service.command.diff:
        class: 'Kunstmaan\TranslatorBundle\Service\Command\DiffCommand'
        deprecated: 'The "%service_id%" service is deprecated since KunstmaanTranslatorBundle 5.2 and will be removed in 6.0.'

    kunstmaan_translator.datacollector:
        class: Kunstmaan\TranslatorBundle\Toolbar\DataCollectorTranslator
        arguments:
            - '@translator.default'

    kunstmaan_translator.datacollector.translations:
        class: '%kunstmaan_translator.toolbar.collector.translator.class%'
        parent: Kunstmaan\AdminBundle\Helper\Toolbar\AbstractDataCollector
        arguments:
            - '@kunstmaan_translator.datacollector'
            - '@router'
        tags:
            - { name: kunstmaan_admin.toolbar_collector, template: '@KunstmaanTranslator/Toolbar/translations.html.twig', id: kuma_translation}

    Kunstmaan\TranslatorBundle\DataFixtures\ORM\TranslationFixtures:
        tags:
            - { name: doctrine.fixture.orm }
