mirror of
https://github.com/ParisNeo/lollms-webui.git
synced 2024-12-18 20:17:50 +00:00
Update web.app.localizer.js
This commit is contained in:
parent
23925f1032
commit
7cdfc1f018
@ -58,9 +58,14 @@ class WebAppLocalizer {
|
||||
const key = element.getAttribute('data-translate');
|
||||
const useHTML = element.hasAttribute('data-translate-html');
|
||||
|
||||
if (useHTML) {
|
||||
if (key.includes('placeholder')) {
|
||||
// If the key contains "placeholder", set the translation as the placeholder attribute
|
||||
element.setAttribute('placeholder', this.translate(key));
|
||||
} else if (useHTML) {
|
||||
// If data-translate-html is present, set the translation as innerHTML
|
||||
element.innerHTML = this.translate(key);
|
||||
} else {
|
||||
// Otherwise, set the translation as textContent
|
||||
element.textContent = this.translate(key);
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user