Heya,
I'm having some concerns with regard to how translations are working at
the moment, let me explain with this twig code:
Translates "Hello firstname" and then replaces firstname by foo from the
resulting translated string<br />
{% trans 'Hello firstname' with {'firstname': 'foo'} %}<br />
Translates "Hello firstname" and then replaces firstname by foo from the
resulting translated string<br />
{% trans with {'firstname': 'foo'} %}Hello firstname{% endtrans %}<br />
Translates "Hello {{ firstname }}" and then replaces {{ firstname }} by
foo from the resulting translated string<br />
{% set firstname = 'foo' %}
{% trans %}Hello {{ firstname }}{% endtrans %}<br />
Assuming you have a messages.en.yml file containing:
"Hello firstname": FOO firstname
"Hello {{ firstname }}": FOO {{ firstname }}
Then the above code outputs three times "FOO foo".
However as we see there is a difference between the two first syntaxes
(using the first line from messages.en.yml) and the last one using the
second line.
What I would like to see is some unification. They should imo all use {{
firstname }}, so {{ / }} should be added to all the parameter names.
Ideally I would prefer %firstname% because it's shorter and less
sensitive for translators to keep well formatted (it doesn't have any
whitespace).
Cheers
--
Jordi Boggiano
@seldaek :: http://seld.be/
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en