lexik/LexikTranslationBundle — pull request #105 by krzysztofbitnoise (2014-10-10 13:34:07+00:00)
Title: Fixed bad path to the app directory at TransUnitFormHandler definition.

Add new translations dosen't work at my project.

While create new TransUnit, its translations are linked to the real files at line 96 TransUnitFormHandler

But $this->rootDir.'/Resources/translations' points to something like ../app/cache/[env]/Resources/translations which doesn't exists.
Even that, a new entity file is created with none existsten path property /cache/[env]/Resources/translations
The translation is created succesfully. But while export will be an error:

Output file: /app/cache/dev/Resources/translations/messages.pl.yml
1 translations to export: PHP Warning: file_put_contents(app/cache/dev/Resources/translations/messages.pl.yml): failed to open stream: No such file or directory in vendor/lexik/translation-bundle/Lexik/Bundle/TranslationBundle/Translation/Exporter/YamlExporter.php on line 39

That is why I changed 5th argument definition of TransUnitFormHandler from %kernel.cache_dir% to %kernel.root_dir% at services.xml, which points to real file path: app/Resources/translations/messages.[locale].yml