From: Daniel Kinzler Date: Wed, 25 Apr 2007 12:42:18 +0000 (+0000) Subject: introducing magic word {{USERLANG}}; This should fix a lot of problems for multilingu... X-Git-Tag: 1.31.0-rc.0~53234 X-Git-Url: http://git.cyclocoop.org/%22.%24info%5B?a=commitdiff_plain;h=ee4ddd5ded8dbba3243ef1897b6ce1475db1d29a;p=lhc%2Fweb%2Fwiklou.git introducing magic word {{USERLANG}}; This should fix a lot of problems for multilingual wikis. --- diff --git a/includes/MagicWord.php b/includes/MagicWord.php index bf72a0c841..e8fc59a26f 100644 --- a/includes/MagicWord.php +++ b/includes/MagicWord.php @@ -97,6 +97,7 @@ class MagicWord { 'localtimestamp', 'directionmark', 'language', + 'userlanguage', 'contentlanguage', 'pagesinnamespace', 'numberofadmins', diff --git a/includes/Parser.php b/includes/Parser.php index 7f34fa1e7b..73c86d5659 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -2560,9 +2560,11 @@ class Parser return $wgScriptPath; case 'directionmark': return $wgContLang->getDirMark(); + case 'userlanguage': + global $wgLang; + return $wgLang->getCode(); case 'contentlanguage': - global $wgContLanguageCode; - return $wgContLanguageCode; + return $wgContLang->getCode(); default: $ret = null; if ( wfRunHooks( 'ParserGetVariableValueSwitch', array( &$this, &$varCache, &$index, &$ret ) ) ) diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index b4a2aca21b..64e1dbdac9 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -329,6 +329,7 @@ $magicWords = array( 'localtimestamp' => array( 1, 'LOCALTIMESTAMP' ), 'directionmark' => array( 1, 'DIRECTIONMARK', 'DIRMARK' ), 'language' => array( 0, '#LANGUAGE:' ), + 'userlanguage' => array( 1, 'USERLANGUAGE', 'USERLANG' ), 'contentlanguage' => array( 1, 'CONTENTLANGUAGE', 'CONTENTLANG' ), 'pagesinnamespace' => array( 1, 'PAGESINNAMESPACE:', 'PAGESINNS:' ), 'numberofadmins' => array( 1, 'NUMBEROFADMINS' ),