diff options
author | Florian Dold <florian.dold@gmail.com> | 2018-02-22 08:58:48 +0100 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2018-02-22 08:58:48 +0100 |
commit | f4d39c10e56a9ad1737dcdf290e31095ad66b7ee (patch) | |
tree | 7339286df95be331fd0baf2ed17fc3b6b5bbc58e /tooling | |
parent | a4e6966241d418b8df05ddd7fc5556ce3c6c97af (diff) |
Swedish translation, i18n fixes
Diffstat (limited to 'tooling')
-rw-r--r-- | tooling/pogen/pogen.js | 9 | ||||
-rw-r--r-- | tooling/pogen/pogen.ts | 9 |
2 files changed, 16 insertions, 2 deletions
diff --git a/tooling/pogen/pogen.js b/tooling/pogen/pogen.js index 03cc0c34e..787a7ec7e 100644 --- a/tooling/pogen/pogen.js +++ b/tooling/pogen/pogen.js @@ -188,7 +188,14 @@ function processFile(sourceFile) { case ts.SyntaxKind.JsxText: { var e = childNode; - var t = e.getText().split("\n").map(trim).join("\n"); + var s = e.getText(); + var 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 + " "; + } fragments.push(t); } case ts.SyntaxKind.JsxOpeningElement: diff --git a/tooling/pogen/pogen.ts b/tooling/pogen/pogen.ts index 5721b5712..0903b9db7 100644 --- a/tooling/pogen/pogen.ts +++ b/tooling/pogen/pogen.ts @@ -211,7 +211,14 @@ export function processFile(sourceFile: ts.SourceFile) { case ts.SyntaxKind.JsxText: { let e = childNode as ts.JsxText; - let t = e.getText().split("\n").map(trim).join("\n"); + 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 + " "; + } fragments.push(t); } case ts.SyntaxKind.JsxOpeningElement: |