From c8131bbebf1f834dc88d452850b9d56ab8d74ea3 Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Fri, 4 Jul 2014 14:51:02 +0200 Subject: [PATCH] Fixed language issue --- wcfsetup/install/files/lib/data/language/Language.class.php | 3 +++ .../plugin/LanguageModifierTemplatePlugin.class.php | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) 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]); } } -- 2.20.1