Not signed in (Sign In)
Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    • CommentAuthoralexandre
    • CommentTimeNov 12th 2007 edited
     

    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!

    • CommentAuthoralexandre
    • CommentTimeNov 13th 2007 edited
     

    I worked around this by explicitly setting the session's 'lang' value on top of calling AK::lang():

    $_SESSION['lang'] = 'fr';
    
Add your comments
    Username Password
  • Format comments as