From 5b73aefa87066364bcb83307b4d598cf034d9dd4 Mon Sep 17 00:00:00 2001 From: Marjolaine Le Bon <marjolaine@nantes.happy-dev.fr> Date: Thu, 24 Feb 2022 21:07:52 +0100 Subject: [PATCH] Update intl.js --- src/scripts/intl.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/scripts/intl.js b/src/scripts/intl.js index ee503976..c3f5d469 100644 --- a/src/scripts/intl.js +++ b/src/scripts/intl.js @@ -113,6 +113,16 @@ class JsI18n { } } } + if (attr.startsWith('enum-')) { + let enum = node.querySelector('[enum="' + attr.replace("enum-", "") + '"]'); + if (enum != null) { + this.translateNodeContent(enum.attributes['enum'], k); + let input = node.querySelector('[name="' + attr.replace("enum-", "") + '"] > input'); + if (input != null) { + this.translateNodeContent(input.attributes['enum'], k); + } + } + } this.translateNodeContent(node.attributes[attr], k); } } @@ -285,4 +295,4 @@ document.addEventListener("DOMContentLoaded", () => { clearTimeout(timer); timer = setTimeout(() => window.orbit.intl.processNode(document.querySelector('body')), 500); }); -}); \ No newline at end of file +}); -- GitLab