r49619 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r49618‎ | r49619 | r49620 >
Date:07:37, 18 April 2009
Author:raymond
Status:deferred
Tags:
Comment:
Cleanup for new extension added per r49611:
* Prefix message keys with extension name to avoid conflicts with message keys from other extensions
* Enable PLURAL for 'semantictasks-reminder-message'
* Tweak English messages a bit
* Add description message
* Remove useless ?>
* Add a FIXME for extension URL
* Add extension to translatewiki.net
Modified paths:
  • /trunk/extensions/SemanticTasks/ST_CheckForReminders.php (modified) (history)
  • /trunk/extensions/SemanticTasks/ST_Notify_Assignment.php (modified) (history)
  • /trunk/extensions/SemanticTasks/SemanticTasks.i18n.php (modified) (history)
  • /trunk/extensions/SemanticTasks/SemanticTasks.php (modified) (history)
  • /trunk/extensions/Translate/groups/mediawiki-defines.txt (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticTasks/SemanticTasks.php
@@ -19,11 +19,12 @@
2020 #Informations
2121 $wgExtensionCredits['parserhook'][] = array(
2222 'name' => 'SemanticTasks',
23 - 'author' =>'Steren Giannini',
24 - 'version' => '1.1',
25 - 'url' => 'http://www.creativecommons.org',
26 - 'description' => 'Email notifications for assigned or updated tasks.'
27 - );
 23+ 'author' => 'Steren Giannini',
 24+ 'version' => '1.1.1',
 25+ 'url' => 'http://www.creativecommons.org', //FIXME: URL should point to a page about this extension
 26+ 'description' => 'Email notifications for assigned or updated tasks.',
 27+ 'descriptionmsg' => 'semantictasks-desc',
 28+);
2829
2930 //Do st_SetupExtension after the mediawiki setup, AND after SemanticMediaWiki setup
3031 $wgExtensionFunctions[] = 'st_SetupExtension';
@@ -33,5 +34,3 @@
3435
3536 // ST_Notify_Assignment.php
3637 require_once( $stIP . "/ST_Notify_Assignment.php" );
37 -
38 -?>
Index: trunk/extensions/SemanticTasks/ST_CheckForReminders.php
@@ -15,4 +15,3 @@
1616 fnRemindAssignees( 'http://teamspace.creativecommons.org/' );
1717
1818 print( "ST check for reminders\n" );
19 -?>
Index: trunk/extensions/SemanticTasks/ST_Notify_Assignment.php
@@ -13,9 +13,9 @@
1414 $rev = $article->estimateRevisionCount();
1515
1616 if( $rev == 1 ) {
17 - fnMailAssignees( $article, $current_user, '['.$wgSitename.'] '. wfMsg( 'newtask' ), 'assignedtoyou_msg', /*diff?*/ false, /*Page text*/ true );
 17+ fnMailAssignees( $article, $current_user, '['.$wgSitename.'] '. wfMsg( 'semantictasks-newtask' ), 'semantictasks-assignedtoyou-msg', /*diff?*/ false, /*Page text*/ true );
1818 } else {
19 - fnMailAssignees( $article, $current_user, '['.$wgSitename.'] '. wfMsg( 'taskupdated' ), 'updatedtoyou_msg', /*diff?*/ true, /*Page text*/ false );
 19+ fnMailAssignees( $article, $current_user, '['.$wgSitename.'] '. wfMsg( 'semantictasks-taskupdated' ), 'semantictasks-updatedtoyou-msg', /*diff?*/ true, /*Page text*/ false );
2020 }
2121 }
2222 return TRUE;
@@ -64,10 +64,10 @@
6565 $assignee_name = $assignee_user_name[1];
6666 $body = wfMsg( $message , $assignee_name , $title ) . $link;
6767 if( $display_text ){
68 - $body .= "\n \n" . wfMsg( 'text-message' ) . "\n" . $article->getContent() ;
 68+ $body .= "\n \n" . wfMsg( 'semantictasks-text-message' ) . "\n" . $article->getContent() ;
6969 }
7070 if( $display_diff){
71 - $body .= "\n \n" . wfMsg( 'diff-message' ) . "\n" . st_generateDiffBody_txt( $title );
 71+ $body .= "\n \n" . wfMsg( 'semantictasks-diff-message' ) . "\n" . st_generateDiffBody_txt( $title );
7272 }
7373
7474 //TEST: uncomment this for test mode (Writes body in testFile)
@@ -172,7 +172,7 @@
173173
174174 while ( $row = $results->getNext() ) {
175175 $task_name = $row[0]->getNextObject()->getTitle();
176 - $subject = '[' . $wgSitename . '] ' . wfMsg( 'reminder' ) . $task_name;
 176+ $subject = '[' . $wgSitename . '] ' . wfMsg( 'semantictasks-reminder' ) . $task_name;
177177 //The following doesn't work, maybe because we use a cron job.
178178 //$link = $task_name->escapeFullURL();
179179 //So let's do it manually
@@ -194,7 +194,7 @@
195195
196196 $assignee = User::newFromName( $assignee_name );
197197 $assignee_mail = new MailAddress( $assignee->getEmail(), $assignee_name );
198 - $body = wfMsg('reminder-message', $assignee_name, $task_name, $remind_me_in, $link );
 198+ $body = wfMsgExt( 'semantictasks-reminder-message', 'parsemag', $assignee_name, $task_name, $remind_me_in, $link );
199199 $user_mailer->send( $assignee_mail, $sender, $subject, $body );
200200 }
201201 }
@@ -220,4 +220,3 @@
221221 fwrite( $fh, $stringData );
222222 fclose( $fh );
223223 }
224 -?>
Index: trunk/extensions/SemanticTasks/SemanticTasks.i18n.php
@@ -1,26 +1,52 @@
22 <?php
 3+/**Internationalization messages file for SemanticTasks extension
 4+ *
 5+ * @addtogroup Extensions
 6+*/
 7+
38 $messages = array();
 9+
 10+/** English (English)
 11+ * @author Steren Giannini
 12+ */
413 $messages['en'] = array(
5 - 'newtask' => 'New Task:',
6 - 'taskupdated' => 'Task Updated:',
7 - 'assignedtoyou_msg' => "Hello $1,\nThe task \"$2\" has just been assigned to you.\n\n",
8 - 'updatedtoyou_msg' => "Hello $1,\nThe task \"$2\" has just been updated.\n\n",
9 - 'reminder' => 'Reminder: ',
10 - 'reminder-message' => "Hello $1, \nJust to remind you that the task \"$2\" ends in $3 days.\n\n$4",
11 - 'text-message' => "Here is the Task description:",
12 - 'diff-message' => "Here are the differences:",
 14+ 'semantictasks-desc' => 'Email notifications for assigned or updated tasks',
 15+ 'semantictasks-newtask' => 'New task:',
 16+ 'semantictasks-taskupdated' => 'Task updated:',
 17+ 'semantictasks-assignedtoyou-msg' => "Hello $1,
 18+
 19+The task \"$2\" has just been assigned to you",
 20+ 'semantictasks-updatedtoyou-msg' => "Hello $1,
 21+
 22+The task \"$2\" has just been updated.",
 23+ 'semantictasks-reminder' => 'Reminder:',
 24+ 'semantictasks-reminder-message' => "Hello $1,
 25+
 26+Just to remind you that the task \"$2\" ends in $3 {{PLURAL:$3|day|days}}.
 27+
 28+$4",
 29+ 'semantictasks-text-message' => "Here is the task description:",
 30+ 'semantictasks-diff-message' => "Here are the differences:",
1331 );
1432
 33+/** French (Français)
 34+ */
 35+$messages['fr'] = array(
 36+ 'semantictasks-newtask' => 'Nouvelle tâche :',
 37+ 'semantictasks-taskupdated' => 'Tâche mise à jour :',
 38+ 'semantictasks-assignedtoyou-msg' => "Bonjour $1,
1539
16 -$messages['fr'] = array(
17 - 'newtask' => 'Nouvelle tâche :',
18 - 'taskupdated' => 'Tâche mise à jour :',
19 - 'assignedtoyou_msg' => "Bonjour $1,\nLa tâche \"$2\" vous a été assignée.\n\n",
20 - 'updatedtoyou_msg' => "Bonjour $1,\nLa tâche \"$2\" a été mise à jour.\n\n",
21 - 'reminder' => 'Rappel: ',
22 - 'reminder-message' => "Bonjour $1, \nN'oubliez pas que la tâche \"$2\" se termine dans $3 jours.\n\n$4",
23 - 'text-message' => "Voici la description de la tâche :",
24 - 'diff-message' => "Les différences sont listées ci-dessous :",
 40+La tâche \"$2\" vous a été assignée.",
 41+ 'semantictasks-updatedtoyou-msg' => "Bonjour $1,
 42+
 43+La tâche \"$2\" a été mise à jour.",
 44+ 'semantictasks-reminder' => 'Rappel :',
 45+ 'reminder-message' => "Bonjour $1,
 46+
 47+N'oubliez pas que la tâche \"$2\" se termine dans $3 jours.
 48+
 49+$4",
 50+ 'semantictasks-text-message' => "Voici la description de la tâche :",
 51+ 'semantictasks-diff-message' => "Les différences sont listées ci-dessous :",
2552 );
2653
27 -?>
Index: trunk/extensions/Translate/groups/mediawiki-defines.txt
@@ -674,6 +674,8 @@
675675 optional = smw_csv_link
676676 optional = smw_json_link
677677
 678+Semantic Tasks
 679+
678680 Shared User Rights
679681 descmsg = gblrights-desc
680682

Follow-up revisions

RevisionCommit summaryAuthorDate
r49624Follow up r49611/r49619: Use formatNum for numbers.raymond10:46, 18 April 2009

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r49611Adding current version (1.0) of SemanticTasks.laner04:37, 18 April 2009

Status & tagging log