Skip to content

[Bug] Error message in console due to rewritten language selection #1090

@ann0see

Description

@ann0see

URL
https://jamulus.io

Describe the bug

<script>
var ja = window.navigator.language || window.navigator.userLanguage;
var mu = document.documentElement.lang;
var lus = [{% for lng in site.languages %}"{{ lng }}",{% endfor %}];
var regex = RegExp('^' + mu);
if (!regex.test(ja)) { // the language the browser has sent is not the language of the document
// check if we support the language of the browser
lus.forEach(function (lng, i) {
if (ja.match('^' + lng)) { // this language is supported. We could add a suggestion here
document.getElementById('langselect').classList.add('chlang','red');
document.getElementById('suglang').style.display = "block";
document.querySelectorAll('[data-slang='+ lng +']')[0].classList.add("proplang");
}
});
}
does not find suglang as the respective code has been removed (if we use the "new" language selector)

We should have a way to still mark suggested languages somehow.

@ignotus666

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    Status

    Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions