<?xml version="1.0" ?>

<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">

    <parameters>
        <parameter key="lexik_translation.translator.class">Lexik\Bundle\TranslationBundle\Translation\Translator</parameter>
        <parameter key="lexik_translation.loader.database.class">Lexik\Bundle\TranslationBundle\Translation\Loader\DatabaseLoader</parameter>
        <parameter key="lexik_translation.trans_unit.manager.class">Lexik\Bundle\TranslationBundle\Manager\TransUnitManager</parameter>
        <parameter key="lexik_translation.file.manager.class">Lexik\Bundle\TranslationBundle\Manager\FileManager</parameter>
        <parameter key="lexik_translation.locale.manager.class">Lexik\Bundle\TranslationBundle\Manager\LocaleManager</parameter>
        <parameter key="lexik_translation.importer.file.class">Lexik\Bundle\TranslationBundle\Translation\Importer\FileImporter</parameter>
        <parameter key="lexik_translation.exporter_collector.class">Lexik\Bundle\TranslationBundle\Translation\Exporter\ExporterCollector</parameter>
        <parameter key="lexik_translation.exporter.xliff.class">Lexik\Bundle\TranslationBundle\Translation\Exporter\XliffExporter</parameter>
        <parameter key="lexik_translation.exporter.json.class">Lexik\Bundle\TranslationBundle\Translation\Exporter\JsonExporter</parameter>
        <parameter key="lexik_translation.exporter.yml.class">Lexik\Bundle\TranslationBundle\Translation\Exporter\YamlExporter</parameter>
        <parameter key="lexik_translation.exporter.php.class">Lexik\Bundle\TranslationBundle\Translation\Exporter\PhpExporter</parameter>

        <parameter key="lexik_translation.orm.translation_storage.class">Lexik\Bundle\TranslationBundle\Storage\DoctrineORMStorage</parameter>
        <parameter key="lexik_translation.orm.listener.class">Lexik\Bundle\TranslationBundle\Storage\Listener\DoctrineORMListener</parameter>
        <parameter key="lexik_translation.orm.trans_unit.class">Lexik\Bundle\TranslationBundle\Entity\TransUnit</parameter>
        <parameter key="lexik_translation.orm.translation.class">Lexik\Bundle\TranslationBundle\Entity\Translation</parameter>
        <parameter key="lexik_translation.orm.file.class">Lexik\Bundle\TranslationBundle\Entity\File</parameter>

        <parameter key="lexik_translation.mongodb.translation_storage.class">Lexik\Bundle\TranslationBundle\Storage\DoctrineMongoDBStorage</parameter>
        <parameter key="lexik_translation.mongodb.trans_unit.class">Lexik\Bundle\TranslationBundle\Document\TransUnit</parameter>
        <parameter key="lexik_translation.mongodb.translation.class">Lexik\Bundle\TranslationBundle\Document\Translation</parameter>
        <parameter key="lexik_translation.mongodb.file.class">Lexik\Bundle\TranslationBundle\Document\File</parameter>

        <parameter key="lexik_translation.propel.translation_storage.class">Lexik\Bundle\TranslationBundle\Storage\PropelStorage</parameter>
        <parameter key="lexik_translation.propel.trans_unit.class">Lexik\Bundle\TranslationBundle\Propel\TransUnit</parameter>
        <parameter key="lexik_translation.propel.translation.class">Lexik\Bundle\TranslationBundle\Propel\Translation</parameter>
        <parameter key="lexik_translation.propel.file.class">Lexik\Bundle\TranslationBundle\Propel\File</parameter>

        <parameter key="lexik_translation.data_grid.formatter.class">Lexik\Bundle\TranslationBundle\Util\DataGrid\DataGridFormatter</parameter>
        <parameter key="lexik_translation.data_grid.request_handler.class">Lexik\Bundle\TranslationBundle\Util\DataGrid\DataGridRequestHandler</parameter>

        <parameter key="lexik_translation.overview.stats_aggregator.class">Lexik\Bundle\TranslationBundle\Util\Overview\StatsAggregator</parameter>

        <parameter key="lexik_translation.form.handler.trans_unit.class">Lexik\Bundle\TranslationBundle\Form\Handler\TransUnitFormHandler</parameter>

        <parameter key="lexik_translation.listener.get_database_resources.class">Lexik\Bundle\TranslationBundle\EventDispatcher\GetDatabaseResourcesListener</parameter>
        <parameter key="lexik_translation.listener.clean_translation_cache.class">Lexik\Bundle\TranslationBundle\EventDispatcher\CleanTranslationCacheListener</parameter>

        <parameter key="lexik_translation.token_finder.class">Lexik\Bundle\TranslationBundle\Util\Profiler\TokenFinder</parameter>

        <parameter key="lexik_translation.command.import_translations.class">Lexik\Bundle\TranslationBundle\Command\ImportTranslationsCommand</parameter>
        <parameter key="lexik_translation.command.export_translations.class">Lexik\Bundle\TranslationBundle\Command\ExportTranslationsCommand</parameter>

        <parameter key="lexik_translation.importer.case_insensitive">false</parameter>
        <parameter key="lexik_translation.token_finder.limit">15</parameter>

        <parameter key="lexik_translation.translator.options" type="collection">
            <parameter key="cache_dir">%kernel.cache_dir%/translations</parameter>
            <parameter key="debug">%kernel.debug%</parameter>
        </parameter>
    </parameters>

    <services>
        <!-- Loader -->
        <service id="lexik_translation.loader.database" class="%lexik_translation.loader.database.class%">
            <argument type="service" id="lexik_translation.translation_storage" />
            <tag name="translation.loader" alias="database" />
        </service>

        <!-- Managers -->
        <service id="lexik_translation.trans_unit.manager" class="%lexik_translation.trans_unit.manager.class%" public="true">
            <argument type="service" id="lexik_translation.translation_storage" />
            <argument type="service" id="lexik_translation.file.manager" />
            <argument>%kernel.root_dir%</argument>
        </service>

        <service id="lexik_translation.file.manager" class="%lexik_translation.file.manager.class%">
            <argument type="service" id="lexik_translation.translation_storage" />
            <argument>%kernel.root_dir%</argument>
        </service>

        <service id="lexik_translation.locale.manager" class="%lexik_translation.locale.manager.class%" public="true">
            <argument>%lexik_translation.managed_locales%</argument>
        </service>

        <!-- Importer -->
        <service id="lexik_translation.importer.file" class="%lexik_translation.importer.file.class%" public="true">
            <argument type="collection" /> <!-- translation loaders -->
            <argument type="service" id="lexik_translation.translation_storage" />
            <argument type="service" id="lexik_translation.trans_unit.manager" />
            <argument type="service" id="lexik_translation.file.manager" />
            <call method="setCaseInsensitiveInsert">
                <argument>%lexik_translation.importer.case_insensitive%</argument>
            </call>
        </service>

        <!-- Exporter -->
        <service id="lexik_translation.exporter_collector" class="%lexik_translation.exporter_collector.class%" public="true"/>

        <service id="lexik_translation.exporter.xliff" class="%lexik_translation.exporter.xliff.class%">
            <tag name="lexik_translation.exporter" alias="xlf" />
        </service>

        <service id="lexik_translation.exporter.json" class="%lexik_translation.exporter.json.class%">
            <argument>%lexik_translation.exporter.json.hierarchical_format%</argument>
            <tag name="lexik_translation.exporter" alias="json" />
        </service>

        <service id="lexik_translation.exporter.yml" class="%lexik_translation.exporter.yml.class%">
            <argument>%lexik_translation.exporter.yml.use_tree%</argument>
            <tag name="lexik_translation.exporter" alias="yml" />
        </service>

        <service id="lexik_translation.exporter.php" class="%lexik_translation.exporter.php.class%">
            <tag name="lexik_translation.exporter" alias="php" />
        </service>

        <!-- Data grid -->
        <service id="lexik_translation.data_grid.formatter" class="%lexik_translation.data_grid.formatter.class%" public="true">
            <argument type="service" id="lexik_translation.locale.manager" />
            <argument>%lexik_translation.storage.type%</argument>
        </service>

        <service id="lexik_translation.data_grid.request_handler" class="%lexik_translation.data_grid.request_handler.class%" public="true">
            <argument type="service" id="lexik_translation.trans_unit.manager" />
            <argument type="service" id="lexik_translation.file.manager" />
            <argument type="service" id="lexik_translation.translation_storage" />
            <argument type="service" id="lexik_translation.locale.manager" />
            <call method="setCreateMissing">
                <argument>%lexik_translation.dev_tools.create_missing%</argument>
            </call>
            <call method="setDefaultFileFormat">
                <argument>%lexik_translation.dev_tools.file_format%</argument>
            </call>
        </service>

        <!-- Overview -->
        <service id="lexik_translation.overview.stats_aggregator" class="%lexik_translation.overview.stats_aggregator.class%" public="true">
            <argument type="service" id="lexik_translation.translation_storage" />
            <argument type="service" id="lexik_translation.locale.manager" />
        </service>

        <!-- Form -->
        <service id="lexik_translation.form.handler.trans_unit" class="%lexik_translation.form.handler.trans_unit.class%" public="true">
            <argument type="service" id="lexik_translation.trans_unit.manager" />
            <argument type="service" id="lexik_translation.file.manager" />
            <argument type="service" id="lexik_translation.translation_storage" />
            <argument type="service" id="lexik_translation.locale.manager" />
            <argument>%kernel.root_dir%</argument>
        </service>

        <!-- Listener -->
        <service id="lexik_translation.listener.get_database_resources" class="%lexik_translation.listener.get_database_resources.class%">
            <argument type="service" id="lexik_translation.translation_storage" />
            <argument>%lexik_translation.storage.type%</argument>
            <tag name="kernel.event_listener" event="lexik_translation.event.get_database_resources" method="onGetDatabaseResources"  />
        </service>


        <!-- Command -->
        <service id="Lexik\Bundle\TranslationBundle\Command\ImportTranslationsCommand" class="%lexik_translation.command.import_translations.class%">
            <argument type="service" id="translator" />
            <tag name="console.command" />
        </service>

        <service id="Lexik\Bundle\TranslationBundle\Command\ExportTranslationsCommand" class="%lexik_translation.command.export_translations.class%">
            <tag name="console.command" />
        </service>
        
    </services>
</container>
