From d5c5ca224b59df99d1189cf58a08609b3d2db950 Mon Sep 17 00:00:00 2001 From: ilmar Date: Thu, 5 Nov 2020 11:36:22 +0200 Subject: [PATCH] Fix missing arg handling in html10n.js --- src/static/css/pad/gritter.css | 4 +++- src/static/js/html10n.js | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/static/css/pad/gritter.css b/src/static/css/pad/gritter.css index e17367efa..62a1e3de9 100644 --- a/src/static/css/pad/gritter.css +++ b/src/static/css/pad/gritter.css @@ -31,6 +31,8 @@ .gritter-item .gritter-content { flex: 1 auto; text-align: center; + width: 95%; + overflow-wrap: break-word; } .gritter-item .gritter-close { @@ -48,4 +50,4 @@ right: 1rem; transform: none; } -} \ No newline at end of file +} diff --git a/src/static/js/html10n.js b/src/static/js/html10n.js index ee7eec0a7..969a6a1a3 100644 --- a/src/static/js/html10n.js +++ b/src/static/js/html10n.js @@ -779,16 +779,16 @@ window.html10n = (function(window, document, undefined) { function substArguments(str, args) { var reArgs = /\{\{\s*([a-zA-Z\.]+)\s*\}\}/ , match - + var translations = html10n.translations; while (match = reArgs.exec(str)) { if (!match || match.length < 2) return str // argument key not found var arg = match[1] , sub = '' - if (arg in args) { + if (args && arg in args) { sub = args[arg] - } else if (arg in translations) { + } else if (translations && arg in translations) { sub = translations[arg] } else { console.warn('Could not find argument {{' + arg + '}}')