Fix i18n: prevent duplicate text updates
This commit is contained in:
parent
c06f2ade6f
commit
1b74e5793c
@ -1415,7 +1415,10 @@ function updateTexts() {
|
|||||||
document.querySelectorAll('[data-i18n]').forEach(el => {
|
document.querySelectorAll('[data-i18n]').forEach(el => {
|
||||||
const key = el.dataset.i18n;
|
const key = el.dataset.i18n;
|
||||||
if (t[key]) {
|
if (t[key]) {
|
||||||
el.textContent = t[key];
|
// Only update if text is different to avoid unnecessary DOM changes
|
||||||
|
if (el.textContent !== t[key]) {
|
||||||
|
el.textContent = t[key];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user