Index: trunk/extensions/AjaxShowEditors/AjaxShowEditors.i18n.php |
— | — | @@ -8,10 +8,13 @@ |
9 | 9 | $messages = array(); |
10 | 10 | |
11 | 11 | $messages['en'] = array( |
12 | | - 'ajax-se-desc' => 'Shows editing users who is editing the same page', |
13 | | - 'ajax-se-title' => 'Currently editing:', |
14 | | - 'ajax-se-pending' => 'pending refresh ... (click this box or start editing)', |
15 | | - 'ajax-se-idling' => '($1s ago)', |
| 12 | + 'ajax-se-desc' => 'Shows editing users who is editing the same page', |
| 13 | + 'ajax-se-title' => 'Currently editing:', |
| 14 | + 'ajax-se-pending' => 'pending refresh ... (click this box or start editing)', |
| 15 | + 'ajax-se-idling' => '($1s ago)', |
| 16 | + 'ajax-se-pagedoesnotexist' => 'page does not exist', |
| 17 | + 'ajax-se-userinvalid' => 'ERR: user invalid', |
| 18 | + 'ajax-se-usernotfound' => 'ERR: user not found', |
16 | 19 | ); |
17 | 20 | |
18 | 21 | /** Afrikaans (Afrikaans) |
Index: trunk/extensions/AjaxShowEditors/Response.php |
— | — | @@ -17,15 +17,17 @@ |
18 | 18 | global $wgOut; |
19 | 19 | $articleId = intval($articleId); |
20 | 20 | |
| 21 | + wfLoadExtensionMessages( 'AjaxShowEditors' ); |
| 22 | + |
21 | 23 | // Validate request |
22 | 24 | $title = Title::newFromID( $articleId ); |
23 | | - if( !($title) ) { return 'ERR: page id invalid'; } |
| 25 | + if( !($title) ) { return wfMsg( 'ajax-se-pagedoesnotexist' ); } |
24 | 26 | |
25 | 27 | $user = User::newFromSession() ; |
26 | | - if( !$user ) { return 'ERR: user invalid'; } |
| 28 | + if( !$user ) { return wfMsg( 'ajax-se-userinvalid' ); } |
27 | 29 | |
28 | 30 | $username = $user->getName(); |
29 | | - if( !( $user->isLoggedIn() or User::isIP( $username ) ) ) { return 'ERR: user not found'; } |
| 31 | + if( !( $user->isLoggedIn() or User::isIP( $username ) ) ) { return wfMsg( 'ajax-se-usernotfound' ); } |
30 | 32 | |
31 | 33 | |
32 | 34 | // When did the user started editing ? |
— | — | @@ -98,7 +100,6 @@ |
99 | 101 | $editor->editings_user |
100 | 102 | ); |
101 | 103 | |
102 | | - wfLoadExtensionMessages( 'AjaxShowEditors' ); |
103 | 104 | $wikitext .= ' ' . wfMsg( 'ajax-se-idling', '<span>'.$idle.'</span>' ); |
104 | 105 | } |
105 | 106 | return $wikitext ; |