我之前在不同的项目中使用过 JMSTranslationBundle 没有任何问题。
然而,这是我第一个使用 jms/translation-bundle:dev-master 的 Symfony3.4 项目。
配置如下:
jms_translation:
configs:
app:
dirs: ["%kernel.root_dir%", "%kernel.root_dir%/../src"]
output_dir: "%kernel.root_dir%/Resources/translations"
excluded_names: ["*TestCase.php", "*Test.php"]
excluded_dirs: [cache, data, logs, translations]
output-format: yml
运行php bin/console translation:extract --config=app en
正常并创建正确的翻译文件。当我再次运行该命令时,出现以下错误:
The format "yml" does not exist.
不要误认为我以前在这里看到的“.yml~”不存在错误。
当我使用 xliff 格式时我没有问题,我可以多次提取文件,它会按预期工作。
任何帮助将不胜感激 我已经检查了以前项目的所有配置文件几个小时,但我无法查明问题的根源。