MarkAHershberger has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/279743

Change subject: Fix errror messages for validation
......................................................................

Fix errror messages for validation

Change-Id: I5b8b4df338deab23710e6f5ab75bd2b8464c097f
---
M WhoIsWatching_body.php
M i18n/en.json
2 files changed, 4 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WhoIsWatching 
refs/changes/43/279743/1

diff --git a/WhoIsWatching_body.php b/WhoIsWatching_body.php
index 49d0533..293beeb 100644
--- a/WhoIsWatching_body.php
+++ b/WhoIsWatching_body.php
@@ -196,13 +196,13 @@
                $idArray = $formData['users'];
                $pageTitle = Title::newFromID( $formData['titleID'] );
                if ( ! $pageTitle ) {
-                       return "Invalid title id passed: 
{$formData['titleID']}\n";
+                       return "specialwhoiswatching-no-such-title";
                }
 
                foreach ( $idArray as $id ) {
                        $uName = User::newFromId( $id );
                        if ( ! $uName ) {
-                               return "Invalid user ID passed ($id)\n";
+                               return "specialwhoiswatching-no-such-user";
                        }
                        $uName->addWatch( $pageTitle );
                        $this->makeWatcherUnavailable( $id );
diff --git a/i18n/en.json b/i18n/en.json
index 2d609b9..9ce471f 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -9,6 +9,8 @@
        "specialwhoiswatchingusage": "This special page cannot be used on its 
own.\nPlease use the page [[MediaWiki:Number_of_watching_users_pageview]] to 
define an entry point to this special page.",
        "specialwhoiswatchingaddusers": "Add users to watch:",
        "specialwhoiswatchingaddbtn": "Add selected users",
+       "specialwhoiswatching-no-such-title": "No such title.",
+       "specialwhoiswatching-no-such-user": "No such user.",
        "whoiswatchingnousersavailable": "All available users are already 
wataching [[$1]]",
        "whoiswatchingpageview": 
"[{{fullurl:Special:WhoIsWatching/{{FULLPAGENAMEE}}}} $1 watching 
{{PLURAL:$1|user|users}}]"
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/279743
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5b8b4df338deab23710e6f5ab75bd2b8464c097f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WhoIsWatching
Gerrit-Branch: master
Gerrit-Owner: MarkAHershberger <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to