11th October 2011, 23:48
|
|
Senior Member
|
|
Join Date: Jun 2011
Posts: 26
|
|
Quote:
Originally Posted by Optix
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")?> ;)
|
ah well worth a try lol
Bump: one of my m8s went to signup to look at it and got this.
|