diff options
author | Florian Dold <florian.dold@gmail.com> | 2018-02-22 10:25:11 +0100 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2018-02-22 10:25:11 +0100 |
commit | 42eb17e7e021476227b846d45cc43409aa451b6e (patch) | |
tree | 2a962ee3100aae83c83d27b471d2199ac8954065 /tooling/pogen/pogen.ts | |
parent | b15f40aea5adcfed4d7ed499ec01988955bdc929 (diff) | |
download | wallet-core-42eb17e7e021476227b846d45cc43409aa451b6e.tar.xz |
i18n fixes
Diffstat (limited to 'tooling/pogen/pogen.ts')
-rw-r--r-- | tooling/pogen/pogen.ts | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/tooling/pogen/pogen.ts b/tooling/pogen/pogen.ts index 0903b9db7..391843912 100644 --- a/tooling/pogen/pogen.ts +++ b/tooling/pogen/pogen.ts @@ -211,14 +211,8 @@ export function processFile(sourceFile: ts.SourceFile) { case ts.SyntaxKind.JsxText: { let e = childNode as ts.JsxText; - let s = e.getText(); - let t = s.split("\n").map(trim).join("\n"); - if (s.length >= 1 && (s[0] === "\n" || s[0] === " ")) { - t = " " + t; - } - if (s.length >= 1 && (s[s.length-1] === "\n" || s[s.length-1] === " ")) { - t = t + " "; - } + let s = e.getFullText(); + let t = s.split("\n").map(trim).join(" "); fragments.push(t); } case ts.SyntaxKind.JsxOpeningElement: @@ -241,7 +235,7 @@ export function processFile(sourceFile: ts.SourceFile) { } }; ts.forEachChild(node, process); - return fragments.join(""); + return fragments.join("").trim().replace(/ +/g, " "); } function getJsxSingular(node: ts.Node) { |