Nice try ! I really appreciate ;)
In an action, don't test the user culture, it's a lot of work. You can directly use the I18N module :
PHP Code:
$this->getContext()->getI18N()->__("Here is the English sentence.");
It allows you 2 things :
- Symfony fills the "messages.xml" for you in order to translate the string (you've to run a command to do that, but the reporting is automatic).
- When the translation isn't available in German (for exemple), it will display the English one. That's very cool : no error any more :D
In a template, you can directly call the function <?=__("Send")?> ;)