Php JmsI18NBundle-必须设置翻译的目录

Php JmsI18NBundle-必须设置翻译的目录,php,symfony,jms,Php,Symfony,Jms,当我运行命令时 php app/console translation:extract en --enable-extractor=jms_i18n_routing 我得到以下错误: [JMS\TranslationBundle\Exception\InvalidArgumentException] The directory where translations are must be set. 这是捆绑包配置: jms_i18n_routing: default_locale: it l

当我运行命令时

php app/console translation:extract en --enable-extractor=jms_i18n_routing
我得到以下错误:

[JMS\TranslationBundle\Exception\InvalidArgumentException]
The directory where translations are must be set.
这是捆绑包配置:

jms_i18n_routing:
default_locale: it
locales: [it, en]
strategy: prefix
cookie:
    enabled: false

这有什么问题?

运行
translation:extract
命令时,您可以通过使用
--dir
选项定义翻译所在的目录来解决此问题

对于转储,bundle为您提供了一个控制台命令,您可以 可用于更新翻译文件,或仅用于预览所有 已经做出的更改

更新文件:


我必须使用以下命令

php app/console translation:extract en --enable-extractor=jms_i18n_routing --bundle="AcmeFooBundle" --domain="routes"

我试图定义--dir选项,但它不起作用。我修复了指定捆绑包和域选项时出现的错误OK,我不确定,但我认为您也可以在配置中设置域。我认为我的解决方案和您的解决方案都有效,不同之处在于您希望列出所有路由并将routes.en.yml放在app文件夹中,相反,使用我的解决方案,您可以转换特定的包并将routes.en.yml放在其中
php app/console translation:extract en --enable-extractor=jms_i18n_routing --bundle="AcmeFooBundle" --domain="routes"