From 26473671ebb370184936d68584106488dfeee895 Mon Sep 17 00:00:00 2001 From: Indrajith K L Date: Tue, 19 Oct 2021 01:19:31 +0530 Subject: language changes --- src/main.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/main.js') diff --git a/src/main.js b/src/main.js index 9468832..58be588 100644 --- a/src/main.js +++ b/src/main.js @@ -52,7 +52,17 @@ function initLanguages() { function parseCasualMessage(message) { const { content } = message; const parsedMessage = content.trim().toLowerCase(); - if (!casualMessages.hasOwnProperty(parsedMessage)) return null; + if (!casualMessages.hasOwnProperty(parsedMessage)) { + let currentKey; + parsedMessage.split(" ").forEach((lang) => { + if(casualMessages.hasOwnProperty(lang)) { + currentKey = lang; + } + break; + }) + + return currentKey; + } return casualMessages[parsedMessage]; } -- cgit v1.2.3