<p dir="auto">Recently, Javier posted a blog post about supporting « notes » in XLIFF files. As notes are written directly in the XLIFF files by translators for instance, this means the technical guys in charge of the application will have to be warned for notes and open the files.</p>
<p dir="auto">I was wondering if we could enhance the <code class="notranslate">translation:debug</code> command to be able to print the details of one single translation at a time like we already do for routes and services. We could then display the following information for a unique translation : source language, target language, source string, target string, notes (if any) and the list of all catalogues file paths where the translation is set or overriden.</p>
<p dir="auto">In projects, it happens many time that we have to search for the location of a single translation using a grep or ack command. This is quite painful and time consuming. I can't tell how painful it should be for Windows users too. The other problem is when we have to search for translations located in YAML files. Indeed, YAML translation files contain translations defined like this :</p>
<div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="# app/Resources/translations/messages.fr.yml
homepage:
    jumbotron:
        title: Bienvenue chez nous!"><pre class="notranslate"><span class="pl-c"><span class="pl-c">#</span> app/Resources/translations/messages.fr.yml</span>
<span class="pl-ent">homepage</span>:
    <span class="pl-ent">jumbotron</span>:
        <span class="pl-ent">title</span>: <span class="pl-s">Bienvenue chez nous!</span></pre></div>
<p dir="auto">This means the translation can then be used with the key <code class="notranslate">homepage.jumbotron.title</code>. If you want to search for this translation key using grep/ack or whatever tool, you won't be able to find any results as the search key doesn't match any translation keys in the YAML catalogue.</p>
<p dir="auto">That's why I think enhancing the <code class="notranslate">translation:debug</code> command may add value for developers / technical project managers.</p>
<p dir="auto">How can we achieve that?</p>
<p dir="auto">In my opinion, we could generate an aggregated XML or JSON file in the cache directory that contains all translations' metadata. In dev environment we don't want to regenerate it at each single request so we could do that only when we use the <code class="notranslate">translation:debug</code> command.</p>
<p dir="auto">Would you think this enhancement would add value to your projects?</p>
<p dir="auto">I'm implementing a solution which allows the user to log in with passwords generated in Symfony 1.4. Since the mergePasswordAndSalt behaviour must be different to accommodate this (i.e. it should behave differently depending on the algorithm used), I have to duplicate the entire class since I can't access the "algorithm" member variable since it's private.</p>
<p dir="auto">It would make far more sense if this was a protected member instead.</p>