I am following every step in the Translation document of Symfony. But I still cannot make Internationalisation works in Symfony. Instead of translated message I receive the same message. What I am doing wrong? Here is my setup:
1) app/config/config.yml
imports:
- { resource: parameters.yml }
- { resource: security.yml }
framework:
#esi: ~
translator: { fallback: fa }
2) app/parameters.yml
parameters:
database_driver: pdo_mysql
database_host: 127.0.0.1
database_port: null
database_user: root
locale: fa
3) Translation file located in src/App/AppBundle/Resources/translations/addproduct.fa.xliff
<?xml version="1.0"?>
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
<file source-language="en" datatype="plaintext" original="file.ext">
<body>
<trans-unit id="1">
<source>Title</source>
<target>عنوان</target>
</trans-unit>
</body>
</file>
</xliff>
4) Controller
/**
* @Route("{_locale}/test")
*/
public function Test()
{
$translated = $this->get('translator')->trans('Title');
return new Response($translated);
}