* {{lc:}} magic word
authorÆvar Arnfjörð Bjarmason <avar@users.mediawiki.org>
Sat, 22 Oct 2005 19:57:38 +0000 (19:57 +0000)
committerÆvar Arnfjörð Bjarmason <avar@users.mediawiki.org>
Sat, 22 Oct 2005 19:57:38 +0000 (19:57 +0000)
* {{uc:}} magic word

includes/MagicWord.php
includes/Parser.php
languages/Language.php

index 94a1036..ac55efc 100644 (file)
@@ -61,6 +61,8 @@ define('MAG_FULLURL',                 46);
 define('MAG_FULLURLE',                 47);
 define('MAG_LCFIRST',                  48);
 define('MAG_UCFIRST',                  49);
+define('MAG_LC',                       50);
+define('MAG_UC',                       51);
 
 $wgVariableIDs = array(
        MAG_CURRENTMONTH,
index aa4b041..8cc649b 100644 (file)
@@ -2311,16 +2311,24 @@ class Parser
                        }
                }
 
-               # LCFIRST and UCFIRST
+               # LCFIRST, UCFIRST, LC and UC
                if ( !$found ) {
                        $lcfirst =& MagicWord::get( MAG_LCFIRST );
                        $ucfirst =& MagicWord::get( MAG_UCFIRST );
+                       $lc =& MagicWord::get( MAG_LC );
+                       $uc =& MagicWord::get( MAG_UC );
                        if ( $lcfirst->matchStartAndRemove( $part1 ) ) {
                                $text = $linestart . $wgContLang->lcfirst( $part1 );
                                $found = true;
                        } else if ( $ucfirst->matchStartAndRemove( $part1 ) ) {
                                $text = $linestart . $wgContLang->ucfirst( $part1 );
                                $found = true;
+                       } else if ( $lc->matchStartAndRemove( $part1 ) ) {
+                               $text = $linestart . $wgContLang->lc( $part1 );
+                               $found = true;
+                       } else if ( $uc->matchStartAndRemove( $part1 ) ) {
+                                $text = $linestart . $wgContLang->uc( $part1 );
+                                $found = true;
                        }
                }
 
index 01e1612..387d271 100644 (file)
@@ -238,6 +238,8 @@ $wgLanguageNamesEn =& $wgLanguageNames;
        MAG_FULLURLE             => array( 0,    'FULLURLE:'              ),
        MAG_LCFIRST              => array( 0,    'LCFIRST:'               ),
        MAG_UCFIRST              => array( 0,    'UCFIRST:'               ),
+       MAG_LC                   => array( 0,    'LC:'                    ),
+       MAG_UC                   => array( 0,    'UC:'                    ),
 );
 
 #-------------------------------------------------------------------