From a278d41b78f2f29462a929bf10577193aa7aa4c5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Fri, 29 Jul 2016 13:51:15 +0200 Subject: [PATCH] Improve backwards compatibility in WoltLab/WCF/Language --- wcfsetup/install/files/js/WoltLab/WCF/Language.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/wcfsetup/install/files/js/WoltLab/WCF/Language.js b/wcfsetup/install/files/js/WoltLab/WCF/Language.js index 3b3a3ad7a1..97e569c302 100644 --- a/wcfsetup/install/files/js/WoltLab/WCF/Language.js +++ b/wcfsetup/install/files/js/WoltLab/WCF/Language.js @@ -57,7 +57,12 @@ define(['Dictionary', './Template'], function(Dictionary, Template) { if (typeof value === 'string') { // lazily convert to WCF.Template - _languageItems.set(key, new Template(value)); + try { + _languageItems.set(key, new Template(value)); + } + catch (e) { + _languageItems.set(key, new Template('{literal}' + value.replace(/\{\/literal\}/g, '{/literal}{ldelim}/literal}{literal}') + '{/literal}')); + } value = _languageItems.get(key); } -- 2.20.1