Index: trunk/phase3/includes/SpecialPage.php |
— | — | @@ -768,7 +768,15 @@ |
769 | 769 | // Works fine as the first parameter, which appears elsewhere in the |
770 | 770 | // code base. Sighhhh. |
771 | 771 | $args = func_get_args(); |
772 | | - return call_user_func_array( array( $this->getContext(), 'msg' ), $args ); |
| 772 | + $message = call_user_func_array( array( $this->getContext(), 'msg' ), $args ); |
| 773 | + // RequestContext passes context to wfMessage, and the language is set from |
| 774 | + // the context, but setting the language for Message class removes the |
| 775 | + // interface message status, which breaks for example usernameless gender |
| 776 | + // invokations. Restore the flag when not including special page in content. |
| 777 | + if ( !$this->including() ) { |
| 778 | + $message->setInterfaceMessageFlag( true ); |
| 779 | + } |
| 780 | + return $message; |
773 | 781 | } |
774 | 782 | |
775 | 783 | /** |
Index: trunk/phase3/includes/Message.php |
— | — | @@ -90,8 +90,7 @@ |
91 | 91 | * ->plain(); |
92 | 92 | * @endcode |
93 | 93 | * |
94 | | - * @note You cannot parse the text except in the content or interface |
95 | | - * @note languages |
| 94 | + * @note You can parse the text only in the content or interface languages |
96 | 95 | * |
97 | 96 | * @section message_compare_old Comparison with old wfMsg* functions: |
98 | 97 | * |
— | — | @@ -342,6 +341,18 @@ |
343 | 342 | } |
344 | 343 | |
345 | 344 | /** |
| 345 | + * Allows manipulating the interface message flag directly. |
| 346 | + * Can be used to restore the flag after setting a language. |
| 347 | + * @param $value bool |
| 348 | + * @return Message: $this |
| 349 | + * @since 1.20 |
| 350 | + */ |
| 351 | + public function setInterfaceMessageFlag( $value ) { |
| 352 | + $this->interface = (bool) $value; |
| 353 | + return $this; |
| 354 | + } |
| 355 | + |
| 356 | + /** |
346 | 357 | * Enable or disable database use. |
347 | 358 | * @param $value Boolean |
348 | 359 | * @return Message: $this |