【发布时间】:2014-05-15 03:32:19
【问题描述】:
我目前在我的 Symfony2 项目中使用 JMSI18nRoutingBundle,到目前为止它运行良好,但我还需要能够翻译路线本身,例如:
英文路线
/en/my-route/whatever/XXX
西班牙语路线
/es/mi-ruta/lo-que-sea/XXX
总结起来,我需要能够在我的控制器中定义以下内容:
/**
* @Route("route.my_route/route.whatever/XXX")
*/
route.my_route 是来自翻译文件的消息:
messages.en.yml
route:
my_route: my-route
messages.es.yml
route:
my_route: mi-ruta
有谁知道这个捆绑包是否可以做到这一点?如果没有,有没有其他方法可以达到预期的效果?
【问题讨论】: