From 92ee0e1ac4623242b109d40005d6fe02b6e05e26 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Thu, 18 Jul 2013 17:54:23 -0700 Subject: [PATCH] Fix update_locales for zh-TW and similar (fixes #1634) --- data/update_locales.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/data/update_locales.js b/data/update_locales.js index 6501d3b3d..06f909603 100644 --- a/data/update_locales.js +++ b/data/update_locales.js @@ -50,7 +50,7 @@ function getResource(resource, callback) { var locale = {}; results.forEach(function(result, i) { - locale[codes[i]] = yaml.load(result)[codes[i]]; + locale[codes[i]] = result; }); callback(null, locale); @@ -63,10 +63,11 @@ function getResource(resource, callback) { function getLanguage(resource) { return function(code, callback) { + code = code.replace(/-/g, '_'); request.get(resource + 'translation/' + code, { auth : auth }, function(err, resp, body) { if (err) return callback(err); - callback(null, JSON.parse(body).content); + callback(null, yaml.load(JSON.parse(body).content)[code]); }); }; }