Index: trunk/extensions/Babel/Babel.class.php |
— | — | @@ -437,13 +437,20 @@ |
438 | 438 | */ |
439 | 439 | private function _getText( $name, $language, $level ) { |
440 | 440 | |
441 | | - global $wgTitle; |
| 441 | + global $wgTitle, $wgBabelUseLevelZeroCategory; |
442 | 442 | |
| 443 | + $categoryLevel = ":Category:{$this->_addFixes( "$language-$level",'category' )}"; |
| 444 | + $categorySuper = ":Category:{$this->_addFixes( $language,'category' )}"; |
| 445 | + |
| 446 | + if( !$wgBabelUseLevelZeroCategory && $level === '0' ) { |
| 447 | + $categoryLevel = $wgTitle->getFullText(); |
| 448 | + } |
| 449 | + |
443 | 450 | // Try the language of the box in female. |
444 | 451 | $text = wfMsgExt( "babel-$level-n", |
445 | 452 | array( 'language' => $language, 'parsemag' ), |
446 | | - ":Category:{$this->_addFixes( "$language-$level",'category' )}", |
447 | | - ":Category:{$this->_addFixes( $language,'category' )}", |
| 453 | + $categoryLevel, |
| 454 | + $categorySuper, |
448 | 455 | '', |
449 | 456 | $wgTitle->getDBkey() |
450 | 457 | ); |
— | — | @@ -451,8 +458,8 @@ |
452 | 459 | // Get the fallback message for comparison in female. |
453 | 460 | $fallback = wfMsgExt( "babel-$level-n", |
454 | 461 | array( 'language' => Language::getFallbackfor( $language ), 'parsemag' ), |
455 | | - ":Category:{$this->_addFixes( "$language-$level",'category' )}", |
456 | | - ":Category:{$this->_addFixes( $language,'category' )}", |
| 462 | + $categoryLevel, |
| 463 | + $categorySuper, |
457 | 464 | '', |
458 | 465 | $wgTitle->getDBkey() |
459 | 466 | ); |
— | — | @@ -463,8 +470,8 @@ |
464 | 471 | |
465 | 472 | $text = wfMsgExt( "babel-$level", |
466 | 473 | array( 'language' => $language, 'parsemag' ), |
467 | | - ":Category:{$this->_addFixes( "$language-$level",'category')}", |
468 | | - ":Category:{$this->_addFixes( $language,'category' )}", |
| 474 | + $categoryLevel, |
| 475 | + $categorySuper, |
469 | 476 | $name, |
470 | 477 | $wgTitle->getDBkey() |
471 | 478 | ); |
— | — | @@ -499,7 +506,7 @@ |
500 | 507 | $r = ''; |
501 | 508 | |
502 | 509 | // Add to main language category if the level is not zero. |
503 | | - if( $wgBabelUseMainCategories && ( $level === 'N' || ( $wgBabelUseLevelZeroCategory && $level === 0 ) || $level > 0 ) ) { |
| 510 | + if( $wgBabelUseMainCategories && ( $level === 'N' || ( $wgBabelUseLevelZeroCategory && $level === '0' ) || $level > 0 ) ) { |
504 | 511 | |
505 | 512 | // Add category wikitext to box tower. |
506 | 513 | $r .= "[[Category:{$this->_addFixes( $code,'category' )}|$level{$wgUser->getName()}]]"; |
— | — | @@ -510,7 +517,7 @@ |
511 | 518 | |
512 | 519 | // Add to level categories, only adding it to the level 0 |
513 | 520 | // one if it is set to be used. |
514 | | - if( !$wgBabelUseSimpleCategories && ( $level === 'N' || ( $wgBabelUseLevelZeroCategory && $level === 0 ) || $level > 0 ) ) { |
| 521 | + if( !$wgBabelUseSimpleCategories && ( $level === 'N' || ( $wgBabelUseLevelZeroCategory && $level === '0' ) || $level > 0 ) ) { |
515 | 522 | |
516 | 523 | // Add category wikitext to box tower. |
517 | 524 | $r .= "[[Category:{$this->_addFixes( "$code-$level",'category' )}|{$wgUser->getName()}]]"; |