From 56c2e76a346894b84c484c725673c290b77fb8a6 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Sun, 21 Apr 2024 15:13:51 -0300 Subject: challenger ui i18n --- packages/pogen/src/potextract.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'packages/pogen/src') diff --git a/packages/pogen/src/potextract.ts b/packages/pogen/src/potextract.ts index 3e9a95ded..243d44c6f 100644 --- a/packages/pogen/src/potextract.ts +++ b/packages/pogen/src/potextract.ts @@ -171,12 +171,12 @@ function processFile( } function formatMsgLine(head: string, msg: string) { + const m = msg.match(/(.*\n|.+$)/g) + if (!m) return; // Do escaping, wrap break at newlines console.log("head", JSON.stringify(head)); console.log("msg", JSON.stringify(msg)); - let parts = msg - .match(/(.*\n|.+$)/g) - .map((x) => x.replace(/\n/g, "\\n").replace(/"/g, '\\"')) + let parts = m.map((x) => x.replace(/\n/g, "\\n").replace(/"/g, '\\"')) .map((p) => wordwrap(p)) .reduce((a, b) => a.concat(b)); if (parts.length == 1) { -- cgit v1.2.3