Closed tristanbes closed 6 years ago
the problem is not related to .yml
or .xliff
format. but I don't understand the problem what related
backup your translation data and delete app/Resources/translations
folder. fixed for me
https://github.com/schmittjoh/JMSI18nRoutingBundle/issues/212
I don't understand the process.
I moved all files from translations/ to another folder, run the command, which did fine, then replace my files and re-run the command and I got the same error.
The only way I found is to move the .yml files outside the translations
folder just the time to run the command, and move them back, but it's ANNOYING. :-)
absolutely...
@schmittjoh must be interested in this issue
Try to rename your translations to .yaml
instead of .yml
, it helped me to get rid of this message
@bocharsky-bw actually it helped me. :)
Please see #479.
Waiting the merge and release, you can make a workaround by creating a compiler pass like this:
namespace AppBundle\DependencyInjection\Compiler;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
final class TranslationLoaderPass implements CompilerPassInterface
{
public function process(ContainerBuilder $container): void
{
$loaderManagerDefinition = $container->getDefinition('jms_translation.loader_manager');
$loaders = $loaderManagerDefinition->getArgument(0);
$loaders['yml'] = $loaders['yaml'];
$loaderManagerDefinition->replaceArgument(0, $loaders);
}
}
And then register it:
namespace AppBundle;
use AppBundle\DependencyInjection\Compiler\TranslationLoaderPass;
use Symfony\Component\DependencyInjection\Compiler\PassConfig;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;
final class AppBundle extends Bundle
{
public function build(ContainerBuilder $container)
{
parent::build($container);
$container
->addCompilerPass(new TranslationLoaderPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION, -1)
;
}
}
The -1
priority is important! This pass must be called after the vendor one to have the loaders list.
@Soullivaneuh your compiler pass seems to work for me. Thanks!
Hi,
Having 100% of
.xliff
files inResources/translations
adding oneexample.fr.yml
insideResources/translations
and the bundle stops working:The format "yml" does not exist.