0
我有兩個包:AppBundle
和AnotherBundle
。如何從另一個包中加載翻譯
我來翻譯AppBundle
的字符串:
{% trans from 'anotherbundle' %}anotherbundle.string{% endtrans %}
的問題是,當我提取字符串與JMSTranslationBundle翻譯,文件anotherbundle.en.xlf
是AppBundle/Resources/translations
目錄中創建的,而我希望它被創建在AnotherBundle/Resources/translations
目錄中。
要提取的翻譯我使用這個命令:
bin/console translation:extract en --config=app
,我使用的配置是這樣的:
jms_translation:
configs:
app:
dirs: ["%kernel.root_dir%", "%kernel.root_dir%/../src/AppBundle/"]
output_dir: "%kernel.root_dir%/../src/AppBundle/Resources/translations"
ignored_domains: [routes, FOSUserBundle]
excluded_names: ["*TestCase.php", "*Test.php"]
excluded_dirs: [cache, data, logs, web]
我怎樣才能讓JMSTranslationBundle提取翻譯字符串轉換成AnotherBundle
目錄?