View Single Post
  #48  
Old 11th October 2011, 23:48
cooly's Avatar
cooly cooly is offline
Senior Member
 
Join Date: Jun 2011
United Kingdom
Posts: 26
Default
Quote:
Originally Posted by Optix View Post
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.
Attached Thumbnails
membres_validation_id_0_cle_12fdc652e17f3684e76efabe00c6f0e5e89f8add.png