aboutsummaryrefslogtreecommitdiff
path: root/gulpfile.js
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2017-05-29 12:37:35 +0200
committerFlorian Dold <florian.dold@gmail.com>2017-05-29 12:37:35 +0200
commit9950c62579298a5dac8cbd51d700507ce4d90063 (patch)
treec8993f07c501fbb40a08be40d67813c852d186ab /gulpfile.js
parent3f01c9490bd6932aa991ecd86e8aaacecb911efc (diff)
fix strings.ts generation
Diffstat (limited to 'gulpfile.js')
-rw-r--r--gulpfile.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/gulpfile.js b/gulpfile.js
index e7d4ccef3..0f206ed80 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -49,6 +49,7 @@ const Stream = require("stream").Stream;
const vfs = require("vinyl-fs");
const webpack = require("webpack");
const po2json = require("po2json");
+const path = require("path");
const paths = {
ts: {
@@ -322,7 +323,11 @@ function pofilesToJs(targetPath) {
if (error) {
throw error;
}
- const lang = file.stem;
+ const lang = path.basename(file.path, ".po");
+ if (!lang) {
+ throw Error();
+ }
+ console.log("lang", lang);
const pojson = po2json.parse(buf, {format: "jed1.x", fuzzy: true});
outStream.write("strings['" + lang + "'] = " + JSON.stringify(pojson, null, " ") + ";\n");
cb();