Reputation: 23
i'm building a web with a frontend based on wordpress and a private area based on symfony. The web have several languages, to wordpress i use qtranslate and i want to take the language selected in wordpress to change the culture in the symfony part. Any ideas?
Sorry for my english :-/
Thanks!
Upvotes: 1
Views: 75
Reputation: 12342
When you use i18n in Symfony the culture can be switched automatically when you change the "magic" parameter sf_culture
during request (using GET or POST). If this not enough you can switch the culture in an action by calling
$this->getUser()->setCulture($culture);
You can for example keep the current Wordpress culture in a cookie and read the cookie from your Sf backend. You can either change the culture in each action, or create a filter that will check if the Wordpress culture has changed and change it if needed.
Upvotes: 1