Send the Content-Language header when directly loading a translation file
authorJack Allnutt <jack@allnutt.eu>
Sun, 7 Jul 2013 20:20:27 +0000 (21:20 +0100)
committerJack Allnutt <jack@allnutt.eu>
Sun, 7 Jul 2013 20:20:27 +0000 (21:20 +0100)
server/httphandler.js

index 3977a0433dfc0be3cde47db95b0e8df2be1f4f4e..e58a9deaa8ff4ee2e6a55bf9f20b4a63f8856769 100644 (file)
@@ -40,6 +40,8 @@ HttpHandler.prototype.serve = function (request, response) {
     // Kiwi will just use the default en-gb strings baked in to it.
     if (request.url === '/assets/locales/magic.json') {
         return serveMagicLocale.call(this, request, response);
+    } else if (request.url.substr(0, 16) === '/assets/locales/') {
+        response.setHeader('Content-Language', request.url.substr(16, request.url.indexOf('.') - 16));
     }
 
     this.file_server.serve(request, response, function (err) {