php - JmsI18NBundle - 必须设置翻译所在的目录

标签 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

这有什么问题吗?

最佳答案

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

From the documentation,

For dumping, the bundle provides you with a console command which you can use to update your translation files, or also just to preview all changes that have been made.

更新文件:

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

关于php - JmsI18NBundle - 必须设置翻译所在的目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26503788/

相关文章:

hibernate - Open Session In View 如何与 jms 连接/ session 一起使用?

javax.jms.MessageConsumer 在消费者关闭时挂起接收

php - 将 session.gc_probability 和 session.gc_divisor 设置为 100% 是个坏主意吗?

php - Doctrine 不存储 ArrayCollection

java - 无法从jms队列接收消息

php - 如何在 Symfony 中创建列表?

symfony - 在 Twig 中动态调用宏?

php - 在 Woocommerce 编辑帐户页面中添加自定义字段

javascript - RSA 加密、PHP 中的加密 (phpseclib) 和 JavaScript 中的解密 (crypto.subtle)

php - 通过 php 中的表单更新 mysql 数据库