diff: Display "(No difference)" instead of an empty diff
authorumherirrender <umherirrender_de.wp@web.de>
Wed, 10 Jul 2013 19:49:36 +0000 (21:49 +0200)
committerMatmaRex <matma.rex@gmail.com>
Wed, 17 Jul 2013 18:40:35 +0000 (20:40 +0200)
This makes it easier to see the fact, because without a hint, the user
can mean, that there is something missing, but here the missing is okay
and for that, the message is helpful.

Change-Id: I458fb688b0001fb674ece65b3fdabf56fc658a29

RELEASE-NOTES-1.22
includes/diff/DifferenceEngine.php
languages/messages/MessagesEn.php
languages/messages/MessagesQqq.php
maintenance/language/messages.inc

index 5e93c0f..86b0c2b 100644 (file)
@@ -147,6 +147,8 @@ production.
 * Added a new method and hook, User::isEveryoneAllowed() and
   UserIsEveryoneAllowed, for use in situations where a "does everyone have this
   right?" check is used to avoid more expensive checks.
+* Display "(No difference)" instead of an empty diff (when comparing revisions
+  in the history or when previewing changes while editing).
 
 === Bug fixes in 1.22 ===
 * Disable Special:PasswordReset when $wgEnableEmail is false. Previously one
index 4c2de4e..6657667 100644 (file)
@@ -610,6 +610,13 @@ class DifferenceEngine extends ContextSource {
                        return false;
                } else {
                        $multi = $this->getMultiNotice();
+                       // Display a message when the diff is empty
+                       if ( $body === '' ) {
+                               if ( $multi !== '' ) {
+                                       $multi .= '<br />';
+                               }
+                               $multi .= $this->msg( 'diff-empty' )->parse();
+                       }
                        return $this->addHeader( $body, $otitle, $ntitle, $multi, $notice );
                }
        }
index e3af968..9e98cc4 100644 (file)
@@ -1779,6 +1779,7 @@ Note that using the navigation links will reset this column.',
 'compareselectedversions'     => 'Compare selected revisions',
 'showhideselectedversions'    => 'Show/hide selected revisions',
 'editundo'                    => 'undo',
+'diff-empty'                  => '(No difference)',
 'diff-multi'                  => '({{PLURAL:$1|One intermediate revision|$1 intermediate revisions}} by {{PLURAL:$2|one user|$2 users}} not shown)',
 'diff-multi-manyusers'        => '({{PLURAL:$1|One intermediate revision|$1 intermediate revisions}} by more than $2 {{PLURAL:$2|user|users}} not shown)',
 'difference-missing-revision' => '{{PLURAL:$2|One revision|$2 revisions}} of this difference ($1) {{PLURAL:$2|was|were}} not found.
index 1a1b466..fbe715a 100644 (file)
@@ -2305,6 +2305,7 @@ See also:
 
 This message has sometimes a tooltip {{msg-mw|tooltip-undo}}
 {{Identical|Undo}}',
+'diff-empty' => 'This message appears instead of a "diff" when comparing two revisions that are identical.',
 'diff-multi' => "This message appears in the revision history of a page when comparing two versions which aren't consecutive.
 
 *Parameter $1 is the number of revisions
index 49ed880..36abe66 100644 (file)
@@ -930,6 +930,7 @@ $wgMessageStructure = array(
                'compareselectedversions',
                'showhideselectedversions',
                'editundo',
+               'diff-empty',
                'diff-multi',
                'diff-multi-manyusers',
                'difference-missing-revision',