r14490 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r14489‎ | r14490 | r14491 >
Date:01:41, 31 May 2006
Author:robchurch
Status:old
Tags:
Comment:
(bug 3926) Introduce {{#language:}} magic word
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/MagicWord.php (modified) (history)
  • /trunk/phase3/includes/Parser.php (modified) (history)
  • /trunk/phase3/languages/Language.php (modified) (history)

Diff [purge]

Index: trunk/phase3/languages/Language.php
@@ -289,6 +289,7 @@
290290 MAG_URLENCODE => array( 0, 'URLENCODE:' ),
291291 MAG_CURRENTTIMESTAMP => array( 1, 'CURRENTTIMESTAMP' ),
292292 MAG_DIRECTIONMARK => array( 1, 'DIRECTIONMARK', 'DIRMARK' ),
 293+ MAG_LANGUAGE => array( 0, '#LANGUAGE:' ),
293294 );
294295
295296 if (!$wgCachedMessageArrays) {
Index: trunk/phase3/RELEASE-NOTES
@@ -386,6 +386,7 @@
387387 * (bug 6106) Update to Indonesian localisation (id) #17
388388 * (bug 6125) Add links to edit old versions to diff views
389389 * (bug 5127) Auto edit summary when creating redirect page
 390+* (bug 3926) Introduce {{#language:}} magic word
390391
391392 == Compatibility ==
392393
Index: trunk/phase3/includes/Parser.php
@@ -2713,6 +2713,16 @@
27142714 }
27152715 }
27162716
 2717+ # #LANGUAGE:
 2718+ if( !$found ) {
 2719+ $mwLanguage =& MagicWord::get( MAG_LANGUAGE );
 2720+ if( $mwLanguage->matchStartAndRemove( $part1 ) ) {
 2721+ $lang = $wgContLang->getLanguageName( strtolower( $part1 ) );
 2722+ $text = $linestart . ( $lang != '' ? $lang : $part1 );
 2723+ $found = true;
 2724+ }
 2725+ }
 2726+
27172727 # Extensions
27182728 if ( !$found && substr( $part1, 0, 1 ) == '#' ) {
27192729 $colonPos = strpos( $part1, ':' );
Index: trunk/phase3/includes/MagicWord.php
@@ -91,6 +91,7 @@
9292 'MAG_URLENCODE',
9393 'MAG_CURRENTTIMESTAMP',
9494 'MAG_DIRECTIONMARK',
 95+ 'MAG_LANGUAGE',
9596 );
9697 if ( ! defined( 'MEDIAWIKI_INSTALL' ) )
9798 wfRunHooks( 'MagicWordMagicWords', array( &$magicWords ) );
@@ -144,6 +145,7 @@
145146 MAG_URLENCODE,
146147 MAG_CURRENTTIMESTAMP,
147148 MAG_DIRECTIONMARK,
 149+ MAG_LANGUAGE,
148150 );
149151 if ( ! defined( 'MEDIAWIKI_INSTALL' ) )
150152 wfRunHooks( 'MagicWordwgVariableIDs', array( &$wgVariableIDs ) );

Status & tagging log