This commit is contained in:
Official Noob
2019-08-12 19:47:11 +01:00
committed by GitHub
parent 7a36277695
commit 334e32fb6b

View File

@@ -159,9 +159,9 @@ function runThePopup() {
chrome.storage.sync.get(["sponsorTimesContributed"], function(result) { chrome.storage.sync.get(["sponsorTimesContributed"], function(result) {
if (result.sponsorTimesContributed != undefined) { if (result.sponsorTimesContributed != undefined) {
if (result.sponsorTimesContributed > 1) { if (result.sponsorTimesContributed > 1) {
SB.sponsorTimesContributionsDisplayEndWord.innerText = MSG("SPs"); SB.sponsorTimesContributionsDisplayEndWord.innerText = browser.i18n.getMessage("Sponsors");
} else { } else {
SB.sponsorTimesContributionsDisplayEndWord.innerText = MSG("SP"); SB.sponsorTimesContributionsDisplayEndWord.innerText = browser.i18n.getMessage("Sponsor");
} }
SB.sponsorTimesContributionsDisplay.innerText = result.sponsorTimesContributed; SB.sponsorTimesContributionsDisplay.innerText = result.sponsorTimesContributed;
SB.sponsorTimesContributionsContainer.style.display = "unset"; SB.sponsorTimesContributionsContainer.style.display = "unset";
@@ -177,9 +177,9 @@ function runThePopup() {
let viewCount = JSON.parse(xmlhttp.responseText).viewCount; let viewCount = JSON.parse(xmlhttp.responseText).viewCount;
if (viewCount != 0) { if (viewCount != 0) {
if (viewCount > 1) { if (viewCount > 1) {
SB.sponsorTimesViewsDisplayEndWord.innerText = MSG("SPSEGs"); SB.sponsorTimesViewsDisplayEndWord.innerText = browser.i18n.getMessage("Segments");
} else { } else {
SB.sponsorTimesViewsDisplayEndWord.innerText = MSG("SPSEG"); SB.sponsorTimesViewsDisplayEndWord.innerText = browser.i18n.getMessage("Segment");
} }
SB.sponsorTimesViewsDisplay.innerText = viewCount; SB.sponsorTimesViewsDisplay.innerText = viewCount;
@@ -256,11 +256,11 @@ function runThePopup() {
SB.loadingIndicator.innerHTML = ""; SB.loadingIndicator.innerHTML = "";
if (request.found) { if (request.found) {
SB.videoFound.innerHTML = MSG("SP_FOUND"); SB.videoFound.innerHTML = browser.i18n.getMessage("SponsorFound");
displayDownloadedSponsorTimes(request); displayDownloadedSponsorTimes(request);
} else { } else {
SB.videoFound.innerHTML = MSG("SP_NONE"); SB.videoFound.innerHTML = browser.i18n.getMessage("Sponsor404");
} }
} }
@@ -358,7 +358,7 @@ function runThePopup() {
function displayDownloadedSponsorTimes(request) { function displayDownloadedSponsorTimes(request) {
if (request.sponsorTimes != undefined) { if (request.sponsorTimes != undefined) {
//set it to the message //set it to the message
if (SB.downloadedSponsorMessageTimes.innerText != MSG("CWL")) { if (SB.downloadedSponsorMessageTimes.innerText != browser.i18n.getMessage("ChannelWhitelisted")) {
SB.downloadedSponsorMessageTimes.innerText = getSponsorTimesMessage(request.sponsorTimes); SB.downloadedSponsorMessageTimes.innerText = getSponsorTimesMessage(request.sponsorTimes);
} }
@@ -873,7 +873,7 @@ function runThePopup() {
//update startTimeChosen letiable //update startTimeChosen letiable
if (!startTimeChosen) { if (!startTimeChosen) {
startTimeChosen = true; startTimeChosen = true;
SB.sponsorStart.innerHTML = MSG("SP_END"); SB.sponsorStart.innerHTML = browser.i18n.getMessage("SponsorEND");
} else { } else {
resetStartTimeChosen(); resetStartTimeChosen();
} }
@@ -905,7 +905,7 @@ function runThePopup() {
//this is not a YouTube video page //this is not a YouTube video page
function displayNoVideo() { function displayNoVideo() {
document.getElementById("loadingIndicator").innerHTML = MSG("NOTYT"); document.getElementById("loadingIndicator").innerHTML = browser.i18n.getMessage("Sponsor404");
} }
function reportAnIssue() { function reportAnIssue() {
@@ -942,16 +942,16 @@ function runThePopup() {
//see if it was a success or failure //see if it was a success or failure
if (response.successType == 1) { if (response.successType == 1) {
//success //success
addVoteMessage(MSG("VOTE"), UUID) addVoteMessage(browser.i18n.getMessage("VOTED"), UUID)
} else if (response.successType == 0) { } else if (response.successType == 0) {
//failure: duplicate vote //failure: duplicate vote
addVoteMessage("You have already voted this way before.", UUID) addVoteMessage(browser.i18n.getMessage("VOTE_FAIL"), UUID)
} else if (response.successType == -1) { } else if (response.successType == -1) {
if (response.statusCode == 502) { if (response.statusCode == 502) {
addVoteMessage("It seems the sever is down. Contact the dev immediately.", UUID) addVoteMessage(browser.i18n.getMessage("ServerDown"), UUID)
} else { } else {
//failure: unknown error //failure: unknown error
addVoteMessage("A connection error has occured. Error code: " + response.statusCode, UUID) addVoteMessage(browser.i18n.getMessage("connectionError") + response.statusCode, UUID)
} }
} }
} }