我想在 Symfony2
上使用 Gettext
来翻译我的网站。
在 ../Resources/translations/
目录下,我有以下的翻译文件:
translations/en/LC_MESSAGES/en.mo
translations/en/LC_MESSAGES/en.po
translations/fr/LC_MESSAGES/fr.mo
translations/fr/LC_MESSAGES/fr.po
...
我已经按照 Symfony2 cookbook
的帮助配置了默认的本地变量为法语(fr) http://symfony.com/doc/current/book/translation.html#the-locale-and-the-url
当我访问 app_dev.php/fr/hello/test
时,我的“Hello World”是英文的。我还需要配置其他什么吗?
已尝试此配置:在Symfony 2中配置翻译组件以使用gettext