From: Tim Düsterhus Date: Fri, 29 Jul 2016 11:51:15 +0000 (+0200) Subject: Improve backwards compatibility in WoltLab/WCF/Language X-Git-Tag: 3.0.0_Beta_1~923 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a278d41b78f2f29462a929bf10577193aa7aa4c5;p=GitHub%2FWoltLab%2FWCF.git Improve backwards compatibility in WoltLab/WCF/Language --- 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); }