Wednesday, January 28, 2015

Symfony2 with Sonata Admin:

How to translate in Sonata Admin:

  1. You don't need $this->trans
  2. Create a directory "translations" in your bundle directory src/TestBundle/Resources
  3. add a file AcmeTestBundle.zh_CN.yml
  4. app/config/config.yml - default_locale: "zh_CN"
  5. In its content translate it like below:
Name: 名字
Activated: 活性
Children: 孩子