how to set the routing translation based on annotation?

醉酒当歌 提交于 2019-12-05 19:04:16

I found the solution. You just have to set run the following command

php app/console translation:extract fr --bundle=MinnTestBundle --enable-extractor=jms_i18n_routing --output-format=yml

Then, minn/TestBundle/Ressources/translations/routes.fr.yml file will be generated. Customize you route translations & that is it!

Hope it will help others...

You can add multiple route annotations.

/**
 * @Route("/welcome", name="welcome", defaults={"_locale" = "en"})
 * @Route("/bienvenue", name="welcome", defaults={"_locale" = "fr"})
 * @Template()
 */
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!