JmsI18NBundle - 必须设置翻译的目录

时间:2014-10-22 08:59:40

标签: 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
locales: [it, en]
strategy: prefix
cookie:
    enabled: false

这有什么问题?

2 个答案:

答案 0 :(得分:4)

您可以使用--dir选项来定义运行translation:extract命令时翻译所在的目录。

<强> From the documentation,

  

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

更新文件:

  php app/console translation:extract de --dir=./src/ --output-dir=./app/Resources/translations

答案 1 :(得分:0)

我必须使用以下命令

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