From 24c61bab71942c1383c9856a845681e008c421e0 Mon Sep 17 00:00:00 2001 From: Official Noob <31563761+OfficialNoob@users.noreply.github.com> Date: Wed, 7 Aug 2019 17:15:57 +0100 Subject: [PATCH] Auto detect lang --- LANG.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/LANG.js b/LANG.js index 7dc08c3a..58b8fd69 100644 --- a/LANG.js +++ b/LANG.js @@ -1,23 +1,23 @@ // File to store strings for diffrent languages - + lang = navigator.language.replace("-", "_"); // Utils - function getErrorMessage(lang, statusCode) { + function getErrorMessage(statusCode) { if(lang.has(statusCode)) return lang.get(statusCode); return lang.get('Unknown').concat(" Error code: ") + statusCode; } - function MSG(lang, message) { + function MSG(message) { if(lang.has(message)) return lang.get(message); console.warn("Could not find key " + message + " for lang "+lang); return ""; } //Declare Maps - var EN_US = new Map(); + var en_US = new Map(); // Main - EN_US.set(400, 'Server said this request was invalid"') + en_US.set(400, 'Server said this request was invalid"') .set(429, 'You have submitted too many sponsor times for this one video, are you sure there are this many?') .set(409, 'This has already been submitted before') .set(502, 'It seems the server is down. Contact the dev to inform them.')