title: Symfony 3 or 4 Custom Translation Loader
body: <p>I am very confused by symfony translation module. 
  How can one configure a custom translation loader in the config files?</p>
  
  <p>I have my custom loader an it works, based on this example:
  <a href="https://symfony.com/doc/current/components/translation/custom_formats.html" rel="noreferrer">https://symfony.com/doc/current/components/translation/custom_formats.html</a></p>
  
  <p>This works, if I put it in a controller</p>
  
  <pre><code>        $translator = new Translator( 'de' );
          $translator-&gt;addLoader( 'my_format', new MyCsvLoader() );
          $translator-&gt;addResource( 'my_format', $root . '/translations/translations.csv', 'de' );
  
          var_dump( $translator-&gt;trans( 'LB_ABOUT' ) );
  </code></pre>
  
  <p>But I cannot figure it out how can I register this as my "default" translation loader; as this should be used by default. </p>
  
  <p><a href="https://symfony.com/doc/current/reference/dic_tags.html#dic-tags-translation-loader" rel="noreferrer">https://symfony.com/doc/current/reference/dic_tags.html#dic-tags-translation-loader</a></p>
  
  <p><strong>translation.yaml</strong></p>
  
  <pre><code>framework:
      default_locale: 'en'
      translator:
          paths:
              - '%kernel.project_dir%/translations/'
          fallbacks:
              - '%locale%'
  </code></pre>
  
  <p><strong>services.yaml:</strong></p>
  
  <pre><code>App\Translate\MyCsvLoader:
      tags:
          - { name: translation.loader, alias: csv }
  </code></pre>