From bbfd575983676bf95b28854600f773c3c80175ac Mon Sep 17 00:00:00 2001 From: nolan Date: Wed, 29 Jul 2020 12:21:58 -0700 Subject: [PATCH] locale parsing fixes for linux --- language/LocaleLoader.js | 8 +++++--- structure/client/components/commands/information/Help.js | 3 +-- structure/interfaces/Setting.js | 2 ++ structure/moderation/ModerationManager.js | 2 +- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/language/LocaleLoader.js b/language/LocaleLoader.js index c9a258f..4c0868b 100644 --- a/language/LocaleLoader.js +++ b/language/LocaleLoader.js @@ -74,11 +74,13 @@ class LocaleLoader { continue; } } + parsed[matched] = text; - 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}`); + for(const [key, value] of Object.entries(parsed)) { + let text = process.platform === 'win32' ? value.replace(/^(\r)|(\r){1,}$/gu, '').replace(/\r/gu, '\n'): value; + if(process.platform === 'linux') text = text.trim(); + parsed[key] = text; } //console.log(parsed); diff --git a/structure/client/components/commands/information/Help.js b/structure/client/components/commands/information/Help.js index e7a1aa7..defedf3 100644 --- a/structure/client/components/commands/information/Help.js +++ b/structure/client/components/commands/information/Help.js @@ -6,8 +6,7 @@ class HelpCommand extends Command { super(client, { name: 'help', - module: 'information', - disabled: true //REMOVE THIS ONCE DONE + module: 'information' }); this.client = client; diff --git a/structure/interfaces/Setting.js b/structure/interfaces/Setting.js index 166c8a0..2846332 100644 --- a/structure/interfaces/Setting.js +++ b/structure/interfaces/Setting.js @@ -1,3 +1,5 @@ +const { stripIndents } = require('common-tags'); + const Component = require('./Component.js'); class Setting extends Component { diff --git a/structure/moderation/ModerationManager.js b/structure/moderation/ModerationManager.js index 8924e66..afde567 100644 --- a/structure/moderation/ModerationManager.js +++ b/structure/moderation/ModerationManager.js @@ -228,7 +228,7 @@ class ModerationManager { infraction: dictionary.present, targetType: `${targetType}${data.targets.length === 1 ? '' : 's'}`, target: data.targets.map((t) => `**${Util.escapeMarkdown(t)}**`).join(' '), - reason: message.format(data.reason).trim() + reason: message.format(data.reason) })}`; (type === original && !success) //eslint-disable-line ? string = `${str}\n${string}`