From f4dd75720e70341b6b526dd6b89f2417453a1435 Mon Sep 17 00:00:00 2001 From: Jacek Kowalski <Jacek@jacekk.info> Date: Wed, 10 Apr 2019 22:20:00 +0000 Subject: [PATCH] Improve undefined translation detection in index.js --- index.js | 2 +- index.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 4326199..7eda651 100644 --- a/index.html +++ b/index.html @@ -136,6 +136,6 @@ <script src="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha384-tsQFqpEReu7ZLhBV2VZlAu7zcOV+rXbYlF2cqB8txI/8aZajjp4Bqd+V6D5IgvKT" crossorigin="anonymous"></script> <script type="text/javascript" src="lang_pl.js?v4" id="lang_script"></script> <script type="text/javascript" src="common.js?v7"></script> - <script type="text/javascript" src="index.js?v3"></script> + <script type="text/javascript" src="index.js?v4"></script> </body> </html> diff --git a/index.js b/index.js index 8339727..c5e50ad 100644 --- a/index.js +++ b/index.js @@ -282,7 +282,7 @@ var text_name; for(var i = 0; i < elements.length; i++) { text_name = elements[i].dataset.translate; - if(lang[text_name] == undefined) { + if(typeof lang[text_name] === 'undefined') { console.log('Missing translation: ' + text_name); continue; } -- Gitblit v1.9.1