Fix double single quote problem in messages

This commit is contained in:
Joseph Garrone
2021-03-05 00:23:50 +01:00
parent b74323a48e
commit c8e219361b
5 changed files with 338 additions and 333 deletions

View File

@ -1,3 +1,4 @@
import "minimal-polyfills/Object.fromEntries";
import * as fs from "fs";
import { join as pathJoin, relative as pathRelative } from "path";
import { crawl } from "./tools/crawl";
@ -34,10 +35,14 @@ crawl(".").forEach(filePath => {
const [, typeOfPage, language] = match;
(record[typeOfPage] ??= {})[language.replace(/_/g,"-")] =
propertiesParser.parse(
fs.readFileSync(filePath)
.toString("utf8")
(record[typeOfPage] ??= {})[language.replace(/_/g, "-")] =
Object.fromEntries(
Object.entries(
propertiesParser.parse(
fs.readFileSync(filePath)
.toString("utf8")
)
).map(([key, value]: any) => [key, value.replace(/''/g, "'")])
);
});