From: Marcel Werk Date: Fri, 4 Jul 2014 12:51:02 +0000 (+0200) Subject: Fixed language issue X-Git-Tag: 2.1.0_Alpha_1~624 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c8131bbebf1f834dc88d452850b9d56ab8d74ea3;p=GitHub%2FWoltLab%2FWCF.git Fixed language issue --- diff --git a/wcfsetup/install/files/lib/data/language/Language.class.php b/wcfsetup/install/files/lib/data/language/Language.class.php index 698dc9ecd5..5ac83f30d1 100644 --- a/wcfsetup/install/files/lib/data/language/Language.class.php +++ b/wcfsetup/install/files/lib/data/language/Language.class.php @@ -121,6 +121,9 @@ class Language extends DatabaseObject { if (!$staticItem) return ''; if (isset($this->dynamicItems[$item])) { + // assign active language + $variables['__language'] = $this; + return WCF::getTPL()->fetchString($this->dynamicItems[$item], $variables); } diff --git a/wcfsetup/install/files/lib/system/template/plugin/LanguageModifierTemplatePlugin.class.php b/wcfsetup/install/files/lib/system/template/plugin/LanguageModifierTemplatePlugin.class.php index a6022211db..813aae2c33 100644 --- a/wcfsetup/install/files/lib/system/template/plugin/LanguageModifierTemplatePlugin.class.php +++ b/wcfsetup/install/files/lib/system/template/plugin/LanguageModifierTemplatePlugin.class.php @@ -21,6 +21,10 @@ class LanguageModifierTemplatePlugin implements IModifierTemplatePlugin { * @see \wcf\system\template\IModifierTemplatePlugin::execute() */ public function execute($tagArgs, TemplateEngine $tplObj) { - return WCF::getLanguage()->getDynamicVariable($tagArgs[0]); + if (($lang = $tplObj->get('__language')) === null) { + $lang = WCF::getLanguage(); + } + + return $lang->getDynamicVariable($tagArgs[0]); } }