Track Browser and set site language I have these modules installed:

cck-6.x-2.9

i18n-6.x-1.10

token-6.x-1.18

views-6.x-2.16

I would like to set the language of the website by checking the language used by the browser and set that as the website language.

Is this something that is possible?
Can you show an example of how to do this?
If writing code is not an issue you could probably handle this in your custom module's hook_init() implementation by using sessions (to check if the user has been redirected already) and PHP-s $_SERVER['HTTP_ACCEPT_LANGUAGE'] variable. Assuming that your site is using path prefixes to determine the language the code could be something like this:

function mymodule_init() {
  // If the user landed on the front page and hasn't been redireced during their session.
  if (!isset($_SESSION['mymodule_redirected']) &amp;&amp; drupal_is_front_page()) {
    global $language, $base_url;
    $current_lang = $language-&gt;language;
    // Available languages besides the sites main one that is using $base_url as it's path.
    $available_langs = array('en', 'de');
    $langcode = explode(";", $_SERVER['HTTP_ACCEPT_LANGUAGE']);
    $langcode = explode(",", $langcode['0']);
    $langcode = explode("-", $langcode['0']);
    $lang = $langcode[0];
    $_SESSION['mymodule_redirected'] = TRUE;
    if (in_array($lang, $available_langs)) {
      if ($lang == 'en' &amp;&amp; $current_lang != 'en') drupal_goto($base_url . '/en');
      if ($lang == 'de' &amp;&amp; $current_lang != 'de') drupal_goto($base_url . '/de');
    }
  }
}