From c8341a448de05deca9972e032f0fca49691892c5 Mon Sep 17 00:00:00 2001 From: Official Noob <31563761+OfficialNoob@users.noreply.github.com> Date: Mon, 12 Aug 2019 18:33:36 +0100 Subject: [PATCH] Switched to native --- LANG.js | 39 ------------------------ _locales/en/messages.json | 63 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+), 39 deletions(-) delete mode 100644 LANG.js create mode 100644 _locales/en/messages.json diff --git a/LANG.js b/LANG.js deleted file mode 100644 index 09264f21..00000000 --- a/LANG.js +++ /dev/null @@ -1,39 +0,0 @@ - // File to store strings for diffrent languages - lang = navigator.language.replace("-", "_"); - - // Utils - function getErrorMessage(statusCode) { - if(lang.has(statusCode)) return lang.get(statusCode); - return lang.get('Unknown').concat(" Error code: ") + statusCode; - } - - 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(); - - // Main -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.') -.set('Unknown', 'There was an error submitting your sponsor times, please try again later.') -.set("CWL","Channel Whitelisted!") -.set("SPs","sponsors.") -.set("SP","sponsor.") -.set("SPSEGs","sponsor segments.") -.set("SPSEG","sponsor segment.") -.set("SP_FOUND","This video's sponsors are in the database!") -.set("SP_NONE","No sponsors found") -.set("SP_END","Sponsorship Ends Now") -.set("SP_START","Sponsorship Starts Now") -.set("NOTYT","his probably isn't a YouTube tab, or you clicked too early. \n If you know this is a YouTube tab,\n close this popup and open it again.") -.set("VOTE","Thanks for voting!") -.set("VOTE_FAIL","You have already voted this way before.") -.set("It seems the sever is down. Contact the dev immediately.","SBDOWN") - - diff --git a/_locales/en/messages.json b/_locales/en/messages.json new file mode 100644 index 00000000..1136bd62 --- /dev/null +++ b/_locales/en/messages.json @@ -0,0 +1,63 @@ +{ + "Name": { + "message": "SponsorBlock", + "description": "Name of the extension." + }, + + "Description": { + "message": "Skip over sponsorship on YouTube videos. Report sponsors on videos you watch to save the time of others.", + "description": "Description of the extension." + }, + + "400": { + "message": "Server said this request was invalid" + }, + "429": { + "message": "You have submitted too many sponsor times for this one video, are you sure there are this many?" + }, + "409": { + "message": "This has already been submitted before" + }, + "502": { + "message": "It seems the server is down. Contact the dev to inform them." + }, + "ChannelWhitelisted": { + "message": "Channel Whitelisted!" + }, + "Sponsor": { + "message": "Sponsor" + }, + "Sponsors": { + "message": "Sponsors" + }, + "Segments": { + "message": "sponsor segments" + }, + "Unknown": { + "message": "There was an error submitting your sponsor times, please try again later." + }, + "SponsorFound": { + "message": "This video's sponsors are in the database!" + }, + "Sponsor404": { + "message": "No sponsors found" + }, + "SponsorStart": { + "message": "Sponsorship Starts Now" + }, + "SponsorEND": { + "message": "Sponsorship Ends Now" + }, + "noVIDEOID": { + "message": "this probably isn't a YouTube tab, or you clicked too early. \n If you know this is a YouTube tab,\n close this popup and open it again." + }, + "VOTED": { + "message": "Thanks for voting!" + }, + "VOTE_FAIL": { + "message": "You have already voted this way before." + }, + "ServerDown": { + "message": "It seems the sever is down. Contact the dev immediately." + }, +}