From: Jack Allnutt Date: Sun, 7 Jul 2013 20:20:27 +0000 (+0100) Subject: Send the Content-Language header when directly loading a translation file X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=eb41f3286bfe37a55c64495327b8989c0b803433;p=KiwiIRC.git Send the Content-Language header when directly loading a translation file --- diff --git a/server/httphandler.js b/server/httphandler.js index 3977a04..e58a9de 100644 --- a/server/httphandler.js +++ b/server/httphandler.js @@ -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) {