Fixed language issue
authorMarcel Werk <burntime@woltlab.com>
Fri, 4 Jul 2014 12:51:02 +0000 (14:51 +0200)
committerMarcel Werk <burntime@woltlab.com>
Fri, 4 Jul 2014 12:51:02 +0000 (14:51 +0200)
wcfsetup/install/files/lib/data/language/Language.class.php
wcfsetup/install/files/lib/system/template/plugin/LanguageModifierTemplatePlugin.class.php

index 698dc9ecd5130a8b8499c10117339cc3dc4aaa3b..5ac83f30d1b50a3b8574b1014ea7246007776577 100644 (file)
@@ -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);
                }
                
index a6022211db3be6af543af57d0953a76c8d195e58..813aae2c33c0432dc654f0ee02dfe5d075b8348c 100644 (file)
@@ -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]);
        }
 }