Commits

Anonymous committed 6f31769

fixed {{CURRENTPAGELANG}} not showing

Comments (0)

Files changed (2)

LangSwitch/LangSwitch.php

     $wgHooks['ParserFirstCallInit'][] = array( &$wgLsInstance, 'getPageLang' );
     $wgHooks['ParserFirstCallInit'][] = array( &$wgLsInstance, 'registerParser' );
 
-    $wgHooks['ParserGetVariableValueSwitch'][] = array( &$wgLsInstance, 'currentpagename');
+    $wgHooks['ParserGetVariableValueSwitch'][] = array( &$wgLsInstance, 'currentpagelang');
     $wgHooks['MagicWordwgVariableIDs'][] = array( &$wgLsInstance, 'declareMagicVar');
     $wgHooks['LanguageGetMagic'][] = array( &$wgLsInstance, 'registerMagic');
     
     
     function registerParser( &$parser ) {
         $parser->setFunctionHook( 'langswitch', array( &$this, 'parseLang' ), SFH_OBJECT_ARGS );
+        $parser->setFunctionHook( 'currentpagelang', array( &$this, 'currentpagelang' ), SFH_NO_HASH );
         return true;
     }
         
         return true;
     }
     
-    function currentpagename( &$parser, &$cache, &$magicWordId, &$ret ) {
-        if ( $magicWordId == 'currentpagename' ) {
+    function currentpagelang( &$parser, &$cache, &$magicWordId, &$ret ) {
+        if ( $magicWordId == 'currentpagelang' ) {
             $ret = $this->pageLang;
         }
         return true;
 TODO:
 
-- fix {{CURRENTPAGELANG}}
+none