Change notification wording

Replace sentence-like wording from yt notifications with predictable, readable-at-a-glance text.

< Părere la script-ul Change notification wording

Recenzie: Bun, script-ul merge

§
Postat în: 12-06-2024
Editat în: 12-06-2024

Works after a tweak. I recommend falling back to en-GB if a matching lang isn't found.

Basically replace

    let siteLang = document.getElementsByTagName("html")[0].getAttribute("lang");
    if (!(siteLang in langs)) { 
        console.error(`Language ${siteLang} is not supported.`);
        return;
    }

with this:

    let siteLang = document.getElementsByTagName("html")[0].getAttribute("lang");
    if (!(siteLang in langs)) {
        console.warn(`Language ${siteLang} is not supported, falling back to en-GB.`);
        siteLang = "en-GB";
    }
§
Postat în: 23-06-2024

I still really like this script. Sooo much easier on the eyes.

Postează un raspuns

Autentifică-te pentru a posta un răspuns.