1
根據knp,this應該是如何輕鬆地將翻譯添加到菜單中。它不適合我。 我的菜單類:Knp菜單翻譯
public function createMainMenuLeft(array $options)
{
$menuLeft = $this->factory->createItem('root', array('childrenAttributes' => array('class' => 'left')));
$menuLeft->addChild('test', array('route' => 'test_route'))
->setExtra('translation_domain', 'AppBundle');
return $menuLeft;
}
在的appbundle /資源/翻譯/ messages.en.yml我
test: nothing
然而,我的菜單仍然有標籤「測試」不翻譯的價值文件。我在這裏錯過了什麼嗎?
我的語言環境設置爲config.yml
至en
。
您是否嘗試過不設置額外的翻譯域? – Matteo
@Matteo是的,我做到了。不工作 – Matt