From a1b59a5ef2cf428f184855ab9a81963ca98e9c37 Mon Sep 17 00:00:00 2001 From: Navy Date: Sat, 25 Jul 2020 12:41:21 +0300 Subject: [PATCH] OS bs --- language/LocaleLoader.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/language/LocaleLoader.js b/language/LocaleLoader.js index 1f11b99..3b793f1 100644 --- a/language/LocaleLoader.js +++ b/language/LocaleLoader.js @@ -50,6 +50,7 @@ class LocaleLoader { loadFile(file) { + if (process.platform === 'linux') file = file.replaceAll('\r', ''); const lines = file.split('\n'); const parsed = {}; @@ -74,9 +75,9 @@ class LocaleLoader { } parsed[matched] = text; - /*if (process.platform === 'win32')*/ for (const [key, value] of Object.entries(parsed)) { + if (process.platform === 'win32') for (const [key, value] of Object.entries(parsed)) { parsed[key] = value.replace(/^(\r)|(\r){1,}$/gu, '').replace(/\r/gu, '\n'); - console.log(String.raw`${value}`); + // console.log(String.raw`${value}`); } return parsed;