Skip to content

Commit

Permalink
more tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
walterbender committed Dec 9, 2023
1 parent 89a0b23 commit 9616f2a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
5 changes: 2 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,13 @@
console.debug(
"The browser is set to " + navigator.language
);
let lang = navigator.language;
if (localStorage.languagePreference) {
console.debug(
"Music Blocks is set to " +
localStorage.languagePreference
);
let lang = localStorage.languagePreference;
} else {
let lang = navigator.language;
lang = localStorage.languagePreference;
}

console.debug("Using " + lang);
Expand Down
8 changes: 5 additions & 3 deletions js/toolbar.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2018,19 Austin George
// COPYRIGHT (c) 2018,19 Austin George
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the The GNU Affero General Public
Expand Down Expand Up @@ -291,9 +291,11 @@ class Toolbar {
const trans = strings_[i];
const elem = docById(obj[0]);
if (strings[i].length === 3) {
elem.innerHTML = obj[1];
if (elem !== undefined) {
elem.innerHTML = obj[1];
}
} else {
if (elem !== null) {
if (elem !== undefined) {
elem.setAttribute("data-tooltip", trans);
}
}
Expand Down

0 comments on commit 9616f2a

Please sign in to comment.