From 736a1b219b52d293bb6967e5c5cada7cc4a1423e Mon Sep 17 00:00:00 2001 From: Jack Allnutt Date: Wed, 12 Feb 2014 17:57:29 +0000 Subject: [PATCH] Upgrade po2json v0.0.6 -> v0.2.3 --- client/build.js | 3 ++- client/src/app.js | 2 +- package.json | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/client/build.js b/client/build.js index aaa06f4..da31785 100644 --- a/client/build.js +++ b/client/build.js @@ -181,8 +181,9 @@ fs.readdir(__dirname + '/src/translations', function (err, translation_files) { var locale = file.slice(0, -3); if ((file.slice(-3) === '.po') && (locale !== 'template')) { - po2json.parse(__dirname + '/src/translations/' + file, function (err, json) { + po2json.parseFile(__dirname + '/src/translations/' + file, {format: 'jed', domain: locale}, function (err, json) { if (!err) { + fs.writeFile(__dirname + '/assets/locales/' + locale + '.json', JSON.stringify(json), function (err) { if (!err) { console.log('Built translation file %s.json', locale); diff --git a/client/src/app.js b/client/src/app.js index 113871d..c15b769 100644 --- a/client/src/app.js +++ b/client/src/app.js @@ -110,7 +110,7 @@ _kiwi.global = { continueStart = function (locale, s, xhr) { if (locale) { - _kiwi.global.i18n = new Jed({locale_data: locale, domain: xhr.getResponseHeader('Content-Language')}); + _kiwi.global.i18n = new Jed(locale); } else { _kiwi.global.i18n = new Jed(); } diff --git a/package.json b/package.json index e130f4b..78017cf 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,6 @@ "socksjs": "0.4.3", "iconv-lite" : "0.2.11", "spdy": "1.14.11", - "po2json": "0.0.6" + "po2json": "0.2.3" } } -- 2.25.1