title: How to retrieve translation of a "sub entity" using Symfony a2lix knp doctrine behaviors translatable
body: <p>I'm new in symfo but I need to translate content of my site.</p>
  
  <p>I'm using a2lix (last version) and KNP doctrine behaviors (Translatable).</p>
  
  <p>Let's say that I have 2 entities (e.g. Articles and Categories).</p>
  
  <p>As in the doc (<a href="https://github.com/KnpLabs/DoctrineBehaviors" rel="nofollow">https://github.com/KnpLabs/DoctrineBehaviors</a>) for translations, I'm using 2 classes for Categories (Category and CategoryTranslation).
  To retrieve the translations, of my category, I'm using a query with the locale. I get the locale with Request $request ($locale = $request->getLocale();). Here is an example of my controller and the query in my repository.</p>
  
  <p><strong>Controller</strong></p>
  
  <pre><code>public function indexAction(Request $request)
      {
          $em = $this-&gt;getDoctrine()-&gt;getManager();
          $locale = $request-&gt;getLocale();
  
          $entities = $em-&gt;getRepository('AcmeBundle:Category')-&gt;findAllByLocale($locale);
  
          return $this-&gt;render('CTCArtworkBundle:Backend/Artwork:index.html.twig', array(
              'entities' =&gt; $entities,
          ));
      }
  </code></pre>
  
  <p><strong>Repository</strong>
  I'm trying to retrieve informations for the locale.</p>
  
  <pre><code>public function findAllByLocale($locale){
  
          return $this-&gt;createQueryBuilder('a')
                     -&gt;join('a.translations', 'aTrans')
                     -&gt;where('aTrans.locale = :locale')
                     -&gt;setParameter("locale", $locale)
                     -&gt;addSelect('aTrans')
                     -&gt;getQuery()
                     -&gt;getResult()
          ;        
  }
  </code></pre>
  
  <p>I don't know if it's a good practice but it works for me. I retrieve fr/en categories in my Twig template like so when I change the url :</p>
  
  <pre><code>&lt;tr&gt;
      &lt;th&gt;Category&lt;/th&gt;
      &lt;td&gt;{{ category.translations|First.name }}&lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p><strong>My problem</strong></p>
  
  <p>For the translation of my article, I do the same. I have 3 properties
  - title
  - description
  - category (I'm using a2lix_translatedEntity (<a href="http://a2lix.fr/bundles/translation-form/#bundle-additional" rel="nofollow">http://a2lix.fr/bundles/translation-form/#bundle-additional</a>))</p>
  
  <p>When I try to render a record of Article, I never retrieve the translation for my category Name but well for title and description.</p>
  
  <p>I also read that (<a href="https://github.com/KnpLabs/DoctrineBehaviors#guess-the-current-locale" rel="nofollow">https://github.com/KnpLabs/DoctrineBehaviors#guess-the-current-locale</a>) but I don't really understand. Is that a way to always pass locale ?</p>
  
  <p>What am I doing wrong ?</p>
  
  <p>I'm blocked and don't find any documentation to resolve my problem. Sorry for my english ;-)</p>
  
  <p>Any help would be very appreciate. Many Thanks</p>