diff --git a/static/src/views/decimal_observer.js b/static/src/views/decimal_observer.js index 7e2aa91..c1e8704 100644 --- a/static/src/views/decimal_observer.js +++ b/static/src/views/decimal_observer.js @@ -74,6 +74,19 @@ function processNode(textNode) { function scanDocument() { + try { + // Check if localization is ready by accessing the property + // This will throw if parameters are not ready + const _ = localization.decimalPoint; + } catch (e) { + // If not ready, retry in 200ms + if (timeout) cancelAnimationFrame(timeout); + timeout = setTimeout(() => { + requestAnimationFrame(scanDocument); + }, 200); + return; + } + const walker = document.createTreeWalker(document.body, NodeFilter.SHOW_TEXT, null); const nodesToProcess = []; while (walker.nextNode()) {