php - Why I can't translated message with id in Symfony 3 -
i newbie symfony. trying translate message languages. can message 'syfony great'. want id id='hello_message'.
my index.twig @ below
{% block body %} <p>{{'hello_message'|trans}}</p> {% endblock %}
my xliff file @ below
<?xml version="1.0"?> <xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2"> <file source-language="en" target-language="en" datatype="plaintext" original="file.ext"> <body> <trans-unit id="hello_message"> <source>hello.message</source> <target>symfony harika!</target> </trans-unit> </body> </file>
and default controller call twig
public function indexaction(request $request) { return $this->render('default/index.html.twig'); }
it's source translated, not id:
{% block body %} <p>{{'hello.message'|trans}}</p> {% endblock %}
also, remember clear cache if you're in prod environment.
Comments
Post a Comment