| Index: trunk/phase3/includes/parser/CoreParserFunctions.php |
| — | — | @@ -68,20 +68,13 @@ |
| 69 | 69 | |
| 70 | 70 | static function ns( $parser, $part1 = '' ) { |
| 71 | 71 | global $wgContLang; |
| 72 | | - $found = false; |
| 73 | 72 | if ( intval( $part1 ) || $part1 == "0" ) { |
| 74 | | - $text = $wgContLang->getNsText( intval( $part1 ) ); |
| 75 | | - $found = true; |
| | 73 | + $index = intval( $part1 ); |
| 76 | 74 | } else { |
| 77 | | - $param = str_replace( ' ', '_', strtolower( $part1 ) ); |
| 78 | | - $index = MWNamespace::getCanonicalIndex( strtolower( $param ) ); |
| 79 | | - if ( !is_null( $index ) ) { |
| 80 | | - $text = $wgContLang->getNsText( $index ); |
| 81 | | - $found = true; |
| 82 | | - } |
| | 75 | + $index = $wgContLang->getNsIndex( str_replace( ' ', '_', $part1 ) ); |
| 83 | 76 | } |
| 84 | | - if ( $found ) { |
| 85 | | - return $text; |
| | 77 | + if ( $index !== false ) { |
| | 78 | + return $wgContLang->getFormattedNsText( $index ); |
| 86 | 79 | } else { |
| 87 | 80 | return array( 'found' => false ); |
| 88 | 81 | } |
| Index: trunk/phase3/RELEASE-NOTES |
| — | — | @@ -158,6 +158,9 @@ |
| 159 | 159 | solutions such as CSS-based overlays and ImageMap. |
| 160 | 160 | * (bug 368) Don't use caption for alt attribute; allow manual specification |
| 161 | 161 | using new "alt=" parameter for images |
| | 162 | +* (bug 44) The {{ns:}} core parser function now also accepts localized namespace |
| | 163 | + names and aliases; also, its output now uses spaces instead of underscores to |
| | 164 | + match the behavior of the {{NAMESPACE}} magic word |
| 162 | 165 | |
| 163 | 166 | === Bug fixes in 1.14 === |
| 164 | 167 | |