update hires logic

This commit is contained in:
Vladimir Mandic
2023-09-11 09:09:38 -04:00
parent 7a8fed1e94
commit 1f730b129f
10 changed files with 62 additions and 61 deletions
+2 -1
View File
@@ -52,6 +52,7 @@ async function setHints() {
const res = await fetch('/file=html/locale_en.json');
const json = await res.json();
localeData.data = Object.values(json).flat();
for (const e of localeData.data) e.label = e.label.toLowerCase().trim();
}
const elements = [
...Array.from(gradioApp().querySelectorAll('button')),
@@ -65,7 +66,7 @@ async function setHints() {
localeData.finished = true;
const t0 = performance.now();
for (const el of elements) {
const found = localeData.data.find((l) => l.label === el.textContent.trim());
const found = localeData.data.find((l) => l.label === el.textContent.toLowerCase().trim());
if (found?.localized?.length > 0) {
localized++;
el.textContent = found.localized;