1 to 2 of 2
Hi again,
The site I'm building has a different domain name for each language, and this is the prefered way to set locale. In my Application controller, I have this:
function __construct()
{
$this->beforeFilter('_pick_language_from_host');
}
function _pick_language_from_host()
{
if ($this->Request->getHost() == AUCTION_FR_HOST) {
AK::lang('fr');
} else {
AK::lang('en');
}
}
The conditions are working fine, since later calls to AK:lang() return the correct language, depending on the domain. But the strings themselves don't get translated at all. They do get translated very well when I add the language code to my URLs.
I don't understand what else I should do to get this work. Any help is very much appreciated. Thanks!
I worked around this by explicitly setting the session's 'lang' value on top of calling AK::lang():
$_SESSION['lang'] = 'fr';
1 to 2 of 2