I know this question may get the dafs-adrenalin of some of you viewers going. But I'm just recently getting my head in there with php and drupal and have been searching the api and googled a possible function only to find functions that did all sorts of other stuff.
It's that I have this custom logic where I want to change the language object after I've set a
$_COOKIE['lang']. The value of the cookie lang would be a language code like
fr. And going
$language->language -> $_COOKIE['lang']; is pretty rediculous.
So the question maybe then is: I Know the value of
$language->language, now I want to use the function that Drupal uses in core to construct the entire language object. This way the language object actually changes after the cookies is set and the locale module can to it's work to load the site in the new language?