2017-04-10 26 views
0

我有兩個包:AppBundleAnotherBundle如何從另一個包中加載翻譯

我來翻譯AppBundle的字符串:

{% trans from 'anotherbundle' %}anotherbundle.string{% endtrans %} 

的問題是,當我提取字符串與JMSTranslationBundle翻譯,文件anotherbundle.en.xlfAppBundle/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目錄?

回答

0

我總是將選項留空,並且翻譯可用於我使用的每個單獨的包中。我只需要引用該域名。