Index: trunk/phase3/includes/GlobalFunctions.php |
— | — | @@ -447,17 +447,15 @@ |
448 | 448 | * @param string $langcode Code of the language to get the message for, or |
449 | 449 | * behaves as a content language switch if it is a |
450 | 450 | * boolean. |
451 | | - * @param bool $fallback Whether or not to fallback to a different language if |
452 | | - * it is not found in the selected one. |
453 | 451 | * @return string |
454 | 452 | * @private |
455 | 453 | */ |
456 | | -function wfMsgGetKey( $key, $useDB, $langCode = false, $transform = true, $fallback = true ) { |
| 454 | +function wfMsgGetKey( $key, $useDB, $langCode = false, $transform = true ) { |
457 | 455 | global $wgParser, $wgContLang, $wgMessageCache, $wgLang; |
458 | 456 | |
459 | 457 | # If $wgMessageCache isn't initialised yet, try to return something sensible. |
460 | 458 | if( is_object( $wgMessageCache ) ) { |
461 | | - $message = $wgMessageCache->get( $key, $useDB, $langCode, false, $fallback ); |
| 459 | + $message = $wgMessageCache->get( $key, $useDB, $langCode ); |
462 | 460 | if ( $transform ) { |
463 | 461 | $message = $wgMessageCache->transform( $message ); |
464 | 462 | } |
— | — | @@ -566,7 +564,6 @@ |
567 | 565 | * <i>replaceafter</i>: parameters are substituted after parsing or escaping |
568 | 566 | * <i>parsemag</i>: transform the message using magic phrases |
569 | 567 | * <i>content</i>: fetch message for content language instead of interface |
570 | | - * <i>nofallback</i>: do not fallback to a different language |
571 | 568 | * <i>language</i>: language code to fetch message for (overriden by <i>content</i>), its behaviour |
572 | 569 | * with parser, parseinline and parsemag is undefined. |
573 | 570 | * Behavior for conflicting options (e.g., parse+parseinline) is undefined. |
— | — | @@ -597,10 +594,8 @@ |
598 | 595 | $langCode = false; |
599 | 596 | } |
600 | 597 | |
601 | | - $fallback = !in_array('nofallback', $options); |
| 598 | + $string = wfMsgGetKey( $key, /*DB*/true, $langCode, /*Transform*/false ); |
602 | 599 | |
603 | | - $string = wfMsgGetKey( $key, /*DB*/true, $langCode, /*Transform*/false, /*Fallback*/$fallback ); |
604 | | - |
605 | 600 | if( !in_array('replaceafter', $options) ) { |
606 | 601 | $string = wfMsgReplaceArgs( $string, $args ); |
607 | 602 | } |
Index: trunk/phase3/includes/MessageCache.php |
— | — | @@ -407,10 +407,8 @@ |
408 | 408 | * use the wikis content language (also as a |
409 | 409 | * fallback). |
410 | 410 | * @param bool $isFullKey Specifies whether $key is a two part key "lang/msg". |
411 | | - * @param bool $fallback Whether or not to fallback to a different language if |
412 | | - * it is not found in the selected one. |
413 | 411 | */ |
414 | | - function get( $key, $useDB = true, $langcode = true, $isFullKey = false, $fallback = true ) { |
| 412 | + function get( $key, $useDB = true, $langcode = true, $isFullKey = false ) { |
415 | 413 | global $wgContLanguageCode, $wgContLang, $wgLang; |
416 | 414 | |
417 | 415 | # Identify which language to get or create a language object for. |
— | — | @@ -478,11 +476,6 @@ |
479 | 477 | } |
480 | 478 | } |
481 | 479 | |
482 | | - # Don't fall back if asked not to. |
483 | | - if( !$fallback ) { |
484 | | - return '<' . htmlspecialchars($key) . '>'; |
485 | | - } |
486 | | - |
487 | 480 | # Try the array of another language |
488 | 481 | $pos = strrpos( $lckey, '/' ); |
489 | 482 | if( $message === false && $pos !== false) { |