fix strings.ts generation
This commit is contained in:
parent
3f01c9490b
commit
9950c62579
@ -49,6 +49,7 @@ const Stream = require("stream").Stream;
|
|||||||
const vfs = require("vinyl-fs");
|
const vfs = require("vinyl-fs");
|
||||||
const webpack = require("webpack");
|
const webpack = require("webpack");
|
||||||
const po2json = require("po2json");
|
const po2json = require("po2json");
|
||||||
|
const path = require("path");
|
||||||
|
|
||||||
const paths = {
|
const paths = {
|
||||||
ts: {
|
ts: {
|
||||||
@ -322,7 +323,11 @@ function pofilesToJs(targetPath) {
|
|||||||
if (error) {
|
if (error) {
|
||||||
throw 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});
|
const pojson = po2json.parse(buf, {format: "jed1.x", fuzzy: true});
|
||||||
outStream.write("strings['" + lang + "'] = " + JSON.stringify(pojson, null, " ") + ";\n");
|
outStream.write("strings['" + lang + "'] = " + JSON.stringify(pojson, null, " ") + ";\n");
|
||||||
cb();
|
cb();
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
export let strings: {[s: string]: any} = {};
|
export let strings: {[s: string]: any} = {};
|
||||||
strings['undefined'] = {
|
strings['de'] = {
|
||||||
"domain": "messages",
|
"domain": "messages",
|
||||||
"locale_data": {
|
"locale_data": {
|
||||||
"messages": {
|
"messages": {
|
||||||
@ -174,7 +174,7 @@ strings['undefined'] = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
strings['undefined'] = {
|
strings['en-US'] = {
|
||||||
"domain": "messages",
|
"domain": "messages",
|
||||||
"locale_data": {
|
"locale_data": {
|
||||||
"messages": {
|
"messages": {
|
||||||
@ -333,7 +333,7 @@ strings['undefined'] = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
strings['undefined'] = {
|
strings['fr'] = {
|
||||||
"domain": "messages",
|
"domain": "messages",
|
||||||
"locale_data": {
|
"locale_data": {
|
||||||
"messages": {
|
"messages": {
|
||||||
@ -492,7 +492,7 @@ strings['undefined'] = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
strings['undefined'] = {
|
strings['it'] = {
|
||||||
"domain": "messages",
|
"domain": "messages",
|
||||||
"locale_data": {
|
"locale_data": {
|
||||||
"messages": {
|
"messages": {
|
||||||
|
Loading…
Reference in New Issue
Block a user