fix: Optimize translation order

pull/8/head
Jad 2023-03-05 16:29:13 +08:00 committed by journey-ad
parent 219ac3a8b3
commit f0a55b07c7
1 changed files with 8 additions and 8 deletions

View File

@ -111,6 +111,14 @@
if (!i18n) return // translation not ready.
if (el.matches?.(ignore_selector)) return // ignore some elements.
if (el.title) {
doTranslate(el, el.title, 'title')
}
if (el.placeholder) {
doTranslate(el, el.placeholder, 'placeholder')
}
if (el.tagName === 'OPTION') {
doTranslate(el, el.textContent, 'option')
} else {
@ -131,14 +139,6 @@
translateEl(node, { deep, rich })
}
})
if (el.title) {
doTranslate(el, el.title, 'title')
}
if (el.placeholder) {
doTranslate(el, el.placeholder, 'placeholder')
}
}
const re_num = /^[\.\d]+$/,