Default locale if one couldn't be negotiated
authorDarren <darren@darrenwhitlen.com>
Thu, 8 May 2014 09:49:03 +0000 (10:49 +0100)
committerDarren <darren@darrenwhitlen.com>
Thu, 8 May 2014 09:49:03 +0000 (10:49 +0100)
server/httphandler.js

index 1fdcf95f7dead34e69d0d33c72a84f5262e7f4c5..f491ddebd5f1d6b0b22e44a2da6452277af689ca 100644 (file)
@@ -93,6 +93,9 @@ var serveMagicLocale = function (request, response) {
     } else {
         negotiator = new Negotiator(request);
         found_locale = negotiator.language(cached_available_locales);
+
+        // If a locale couldn't be negotiated, use the default
+        found_locale = found_locale || default_locale_id;
     }
 
     // Send a locale to the browser