title: Override translator Symfony2
body: <p>I am trying to override the Symfony translator to have some translations from my database.
  I am first checking if the translation is not in a catalogue and if not load it from the database</p>
  
  <pre><code>&lt;?php
  
  namespace Competitive\TranslationBundle\Translation;
  
  use Competitive\TranslationBundle\Entity\TranslationManager;
  use Symfony\Component\Translation\MessageSelector;
  use Symfony\Component\Translation\Translator as BaseTranslator;
  
  class Translator extends BaseTranslator
  {
      /**
       * @var TranslationManager
       */
      private $translationManager;
  
      public function __construct($locale, TranslationManager $translationManager, MessageSelector $selector = null, $cacheDir = null, $debug = false)
      {
          parent::__construct($locale, $selector, $cacheDir, $debug);
          $this-&gt;translationManager = $translationManager;
      }
  
      /**
       * {@inheritdoc}
       */
      public function trans($id, array $parameters = array(), $domain = null, $locale = null)
      {
          $catalogueDomain = $domain;
          if (null === $catalogueDomain) {
              $catalogueDomain = 'messages';
          }
  
          $locale = $locale === null ? $this-&gt;getLocale() : $locale;
  
          if ($this-&gt;getCatalogue($locale)-&gt;has($id, $domain)) {
              return parent::trans($id, $parameters, $catalogueDomain, $locale);
          }
  
          $translations = $this-&gt;translationManager-&gt;findTranslationsBy([
              'key' =&gt; $id,
              'locale' =&gt; $locale
          ]);
  
          if (empty($translations)) {
              $translation = $this-&gt;translationManager-&gt;create($id, $id, $locale);
          } elseif (null === $domain) {
              $translation = $translations[0];
          } else {
              foreach ($translations as $trans) {
                  if ($trans-&gt;getDomain() == $domain) {
                      $translation = $trans;
                      break;
                  }
              }
  
              if (!isset($translation)) {
                  $translation = $translations[0];
              }
          }
  
          return strtr($translation-&gt;getValue(), $parameters);
      }
  
      /**
       * {@inheritdoc}
       */
      public function transChoice($id, $number, array $parameters = array(), $domain = null, $locale = null)
      {
          return $this-&gt;trans($id, $parameters, $domain, $locale);
      }
  }
  </code></pre>
  
  <p>translation.yml</p>
  
  <pre><code>services:
      translator:
          class: Competitive\TranslationBundle\Translation\Translator
          arguments:
              - %locale%
              - @competitive_translation.translation_manager
  </code></pre>
  
  <p>The translation is loaded from the database without problem.</p>
  
  <p>But <code>$this-&gt;getCatalogue($locale)-&gt;has($id, $domain)</code> always returns false (the translations from the catalogue were working before the override)</p>
  
  <p>And my cache translation folder <code>app/cache/dev/translations</code> is not generated</p>