diff --git a/javascript/bilingual_localization.js b/javascript/bilingual_localization.js index 4813872..81c17ff 100644 --- a/javascript/bilingual_localization.js +++ b/javascript/bilingual_localization.js @@ -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]+$/,