--- language.inc.orig	2009-01-03 00:37:48.000000000 +0100
+++ language.inc.new	2009-02-17 18:37:04.578125000 +0100
@@ -80,7 +80,7 @@ function language_from_browser() {
       // The language part is either a code or a code with a quality.
       // We cannot do anything with a * code, so it is skipped.
       // If the quality is missing, it is assumed to be 1 according to the RFC.
-      if (preg_match("!([a-z-]+)(;q=([0-9\\.]+))?!", trim($browser_accept[$i]), $found)) {
+      if (preg_match("!([a-z]+)-?(;q=([0-9\\.]+))?!", trim($browser_accept[$i]), $found)) {
         $browser_langs[$found[1]] = (isset($found[3]) ? (float) $found[3] : 1.0);
       }
     }
