Siebrand has submitted this change and it was merged.

Change subject: i18n: Supply date/time parameters to some messages
......................................................................


i18n: Supply date/time parameters to some messages

Date/Time parameters added to messages:
* wikiforum-by (Deprecated $1, using date/time)
* wikiforum-posted (Deprecated $1, using date/time)
* wikiforum-edited (Deprecated $1, using date/time)

Spotted by Purodha:
* 
https://translatewiki.net/wiki/Thread:Support/GENDER_support_and_date_and_time_parameters_needed

Change-Id: I405cf7fa3fadbc71b6cf2a4f1782c2ef8be0c226
---
M WikiForum.i18n.php
M WikiForumClass.php
M WikiForumHooks.php
3 files changed, 67 insertions(+), 25 deletions(-)

Approvals:
  Siebrand: Verified; Looks good to me, approved



diff --git a/WikiForum.i18n.php b/WikiForum.i18n.php
index 36bd10b..cc08915 100644
--- a/WikiForum.i18n.php
+++ b/WikiForum.i18n.php
@@ -23,7 +23,7 @@
 
        'wikiforum-anonymous' => 'Anonymous',
        'wikiforum-announcement-only-description' => 'Announcement forum (only 
moderators can add threads)',
-       'wikiforum-by' => '$1<br />by {{GENDER:$3|$2}}',
+       'wikiforum-by' => 'On $4 at $5<br />by {{GENDER:$3|$2}}',
        'wikiforum-description' => 'Description:',
        'wikiforum-forum-is-empty' => 'This forum is currently empty.
 Please contact a forum administrator to have some categories and forums 
added.',
@@ -65,8 +65,8 @@
        'wikiforum-thread-title' => 'Title of your thread',
        'wikiforum-no-threads' => 'No threads are available at the moment.',
 
-       'wikiforum-posted' => 'Posted at $1 by {{GENDER:$3|$2}}',
-       'wikiforum-edited' => 'Edited at $1 by {{GENDER:$3|$2}}',
+       'wikiforum-posted' => 'Posted by {{GENDER:$3|$2}} on $4 at $5.',
+       'wikiforum-edited' => 'Edited by {{GENDER:$3|$2}} on $4 at $5.',
 
        'wikiforum-cat-not-found' => 'Category not found',
        'wikiforum-cat-not-found-text' => 'Category does not exist - go back to 
$1',
@@ -136,9 +136,11 @@
        'wikiforum-anonymous' => '{{Identical|Anonymous}}',
        'wikiforum-announcement-only-description' => 'Used as label for 
checkbox in adding forum page.',
        'wikiforum-by' => 'Forum post properties. Parameters:
-* $1 is a timestamp (time and date)
+* $1 - No longer used
 * $2 is a link to a user page with username as link description.
-* $3 is a plain text username used for GENDER.',
+* $3 is a plain text username used for GENDER.
+* $4 - a date
+* $5 - a time',
        'wikiforum-description' => 'Used as label for "forum description" input 
box.
 {{Identical|Description}}',
        'wikiforum-forum-is-empty' => 'Used in [[Special:WikiForum]] when there 
are no categories/forums/threads.
@@ -211,15 +213,19 @@
        'wikiforum-thread-title' => 'Default title of thread; used in creating 
new thread page.',
        'wikiforum-no-threads' => 'Used in threads list when the forum has no 
available thread.',
        'wikiforum-posted' => 'Thread header. Parameters:
-* $1 - a timestamp
+* $1 - No longer used
 * $2 - a link to a user page with username as link description
 * $3 - a plain text username used for GENDER
+* $4 - a date
+* $5 - a time
 See also:
 * {{msg-mw|Wikiforum-edited}}',
        'wikiforum-edited' => 'Indicates a thread (or a reply) has been edited. 
Parameters:
-* $1 - a timestamp
+* $1 - No longer used
 * $2 - a link to a user page with username as link description
 * $3 - a plain text username used for GENDER
+* $4 - (Optional) a date
+* $5 - (Optional) a time
 See also:
 * {{msg-mw|Wikiforum-posted}}',
        'wikiforum-cat-not-found' => 'Used as heading of error message',
diff --git a/WikiForumClass.php b/WikiForumClass.php
index 6cdad4c..e3539a0 100644
--- a/WikiForumClass.php
+++ b/WikiForumClass.php
@@ -1232,7 +1232,9 @@
                                                        
$forum->wff_last_post_user_text,
                                                        
$forum->wff_last_post_user_ip
                                                ),
-                                               $forum->user_name
+                                               $forum->user_name,
+                                               $wgLang->date( 
$forum->wff_last_post_timestamp ),
+                                               $wgLang->time( 
$forum->wff_last_post_timestamp )
                                        )->text();
                                }
 
@@ -1340,7 +1342,9 @@
                                                        
$forum->wff_last_post_user_text,
                                                        
$forum->wff_last_post_user_ip
                                                ),
-                                               $forum->user_name
+                                               $forum->user_name,
+                                               $wgLang->date( 
$forum->wff_last_post_timestamp ),
+                                               $wgLang->time( 
$forum->wff_last_post_timestamp )
                                        )->text();
                                }
 
@@ -1509,7 +1513,9 @@
                                                        
$thread->wft_last_post_user_text,
                                                        
$thread->wft_last_post_user_ip
                                                ),
-                                               $thread->wft_last_post_user_text
+                                               
$thread->wft_last_post_user_text,
+                                               $wgLang->date( 
$thread->wft_last_post_timestamp ),
+                                               $wgLang->time( 
$thread->wft_last_post_timestamp )
                                        )->text();
                                }
 
@@ -1532,7 +1538,9 @@
                                                                
$thread->wft_user_text,
                                                                
$thread->wft_user_ip
                                                        ),
-                                                       $thread->wft_user_text
+                                                       $thread->wft_user_text,
+                                                       $wgLang->date( 
$thread->wft_posted_timestamp ),
+                                                       $wgLang->time( 
$thread->wft_posted_timestamp )
                                                )->text() . '</p></p>',
                                        $thread->wft_reply_count,
                                        $thread->wft_view_count,
@@ -1707,7 +1715,9 @@
                                        $data_overview->wft_user_text,
                                        $data_overview->wft_user_ip
                                ),
-                               $data_overview->wft_user_text
+                               $data_overview->wft_user_text,
+                               $wgLang->date( 
$data_overview->wft_posted_timestamp ),
+                               $wgLang->time( 
$data_overview->wft_posted_timestamp )
                        )->text();
                        if ( $data_overview->wft_edit_timestamp > 0 ) {
                                $posted .= '<br /><i>' .
@@ -1719,7 +1729,9 @@
                                                        
$data_overview->wft_edit_user_text,
                                                        
$data_overview->wft_edit_user_ip
                                                ),
-                                               
$data_overview->wft_edit_user_text
+                                               
$data_overview->wft_edit_user_text,
+                                               $wgLang->date( 
$data_overview->wft_edit_timestamp ),
+                                               $wgLang->time( 
$data_overview->wft_edit_timestamp )
                                        )->text() . '</i>';
                        }
 
@@ -1762,7 +1774,9 @@
                                                $reply->wfr_user_text,
                                                $reply->wfr_user_ip
                                        ),
-                                       $reply->user_name
+                                       $reply->user_name,
+                                       $wgLang->date( 
$reply->wfr_posted_timestamp ),
+                                       $wgLang->time( 
$reply->wfr_posted_timestamp )
                                )->text();
                                if ( $reply->wfr_edit_timestamp > 0 ) {
                                        $posted .= '<br /><i>' .
@@ -1774,7 +1788,9 @@
                                                                
$reply->wfr_edit_user_text,
                                                                
$reply->wfr_edit_user_ip
                                                        ),
-                                                       
$reply->wfr_edit_user_text
+                                                       
$reply->wfr_edit_user_text,
+                                                       $wgLang->date( 
$reply->wfr_edit_timestamp ),
+                                                       $wgLang->time( 
$reply->wfr_edit_timestamp )
                                                )->text() . '</i>';
                                }
 
@@ -1903,7 +1919,9 @@
                                                $result->wfr_user_text,
                                                $result->wfr_user_ip
                                        ),
-                                       $result->wfr_user_text
+                                       $result->wfr_user_text,
+                                       $wgLang->date( 
$result->wfr_posted_timestamp ),
+                                       $wgLang->time( 
$result->wfr_posted_timestamp )
                                )->text() . '<br />' . wfMessage(
                                                'wikiforum-search-thread',
                                                '<a href="' . $url . $anchor . 
'">' .
@@ -1949,7 +1967,9 @@
                        'wikiforum-posted',
                        $wgLang->timeanddate( wfTimestampNow() ),
                        WikiForumClass::getUserLink( $wgUser->getId(), 
$wgUser->getName(), $wgRequest->getIP() ),
-                       $wgUser->getName()
+                       $wgUser->getName(),
+                       $wgLang->date( wfTimestampNow() ),
+                       $wgLang->time( wfTimestampNow() )
                )->text();
                if ( $type == 'addcomment' || $type == 'editcomment' ) {
                        $output .= WikiForumGui::getReplyHeader( $title );
@@ -2180,7 +2200,9 @@
                                                // <a 
href="/wiki/Project:Administrators">administrator</a>)
                                                // which is *not* what we want
                                                $reply->user_name,
-                                               $reply->user_name
+                                               $reply->user_name,
+                                               $wgLang->date( 
$reply->wfr_posted_timestamp ),
+                                               $wgLang->time( 
$reply->wfr_posted_timestamp )
                                        )->text();
                                        $text_prev = '[quote=' . $posted . ']' .
                                                $reply->wfr_reply_text . 
'[/quote]';
@@ -2200,7 +2222,9 @@
                                                $wgLang->timeanddate( 
$thread->wft_posted_timestamp ),
                                                // see the explanation above
                                                $thread->user_name,
-                                               $thread->user_name
+                                               $thread->user_name,
+                                               $wgLang->date( 
$thread->wft_posted_timestamp ),
+                                               $wgLang->time( 
$thread->wft_posted_timestamp )
                                        )->text();
                                        $text_prev = '[quote=' . $posted . ']' .
                                                $thread->wft_text . '[/quote]';
diff --git a/WikiForumHooks.php b/WikiForumHooks.php
index 9e97e61..fa35666 100644
--- a/WikiForumHooks.php
+++ b/WikiForumHooks.php
@@ -117,7 +117,9 @@
                                        'wikiforum-by',
                                        $wgLang->timeanddate( 
$thread->wft_last_post_timestamp ),
                                        WikiForumClass::getUserLinkById( 
$thread->wft_last_post_user ),
-                                       User::newFromId( 
$thread->wft_last_post_user )->getName()
+                                       User::newFromId( 
$thread->wft_last_post_user )->getName(),
+                                       $wgLang->date( 
$thread->wft_last_post_timestamp ),
+                                       $wgLang->time( 
$thread->wft_last_post_timestamp )
                                )->text();
                        }
 
@@ -147,7 +149,9 @@
                                        'wikiforum-posted',
                                        $wgLang->timeanddate( 
$thread->wft_posted_timestamp ),
                                        WikiForumClass::getUserLink( 
$thread->user_name ),
-                                       $thread->user_name
+                                       $thread->user_name,
+                                       $wgLang->date( 
$thread->wft_posted_timestamp ),
+                                       $wgLang->time( 
$thread->wft_posted_timestamp )
                                )->text() . '<br />' .
                                wfMessage( 'wikiforum-forum', $categoryLink, 
$forumLink )->text() .
                                '</p></p>',
@@ -201,7 +205,9 @@
                                        'wikiforum-posted',
                                        $wgLang->timeanddate( 
$overview->wft_posted_timestamp ),
                                        WikiForumClass::getUserLink( 
$overview->user_name ),
-                                       $overview->user_name
+                                       $overview->user_name,
+                                       $wgLang->date( 
$overview->wft_posted_timestamp ),
+                                       $wgLang->time( 
$overview->wft_posted_timestamp )
                                )->text();
                                if ( $overview->wft_edit_timestamp > 0 ) {
                                        $posted .= '<br /><i>' .
@@ -209,7 +215,9 @@
                                                        'wikiforum-edited',
                                                        $wgLang->timeanddate( 
$overview->wft_edit_timestamp ),
                                                        
WikiForumClass::getUserLinkById( $overview->wft_edit_user ),
-                                                       
$overview->wft_edit_user_text
+                                                       
$overview->wft_edit_user_text,
+                                                       $wgLang->date( 
$overview->wft_edit_timestamp ),
+                                                       $wgLang->time( 
$overview->wft_edit_timestamp )
                                                )->text() . '</i>';
                                }
 
@@ -248,7 +256,9 @@
                                                        'wikiforum-posted',
                                                        $wgLang->timeanddate( 
$reply->wfr_posted_timestamp ),
                                                        
WikiForumClass::getUserLink( $reply->user_name ),
-                                                       $reply->user_name
+                                                       $reply->user_name,
+                                                       $wgLang->date( 
$reply->wfr_posted_timestamp ),
+                                                       $wgLang->time( 
$reply->wfr_posted_timestamp )
                                                )->text();
                                                if ( $reply->wfr_edit > 0 ) {
                                                        $posted .= '<br /><i>' .
@@ -256,7 +266,9 @@
                                                                        
'wikiforum-edited',
                                                                        
$wgLang->timeanddate( $reply->wfr_edit ),
                                                                        
WikiForumClass::getUserLinkById( $reply->wfr_edit_user ),
-                                                                       
$reply->wfr_edit_user_text
+                                                                       
$reply->wfr_edit_user_text,
+                                                                       
$wgLang->date( $reply->wfr_edit ),
+                                                                       
$wgLang->time( $reply->wfr_edit )
                                                                )->text() . 
'</i>';
                                                }
                                                $output .= 
WikiForumGui::getReply(

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I405cf7fa3fadbc71b6cf2a4f1782c2ef8be0c226
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/WikiForum
Gerrit-Branch: master
Gerrit-Owner: MegaAlex <alexivano...@gmail.com>
Gerrit-Reviewer: Bartosz DziewoƄski <matma....@gmail.com>
Gerrit-Reviewer: Nemo bis <federicol...@tiscali.it>
Gerrit-Reviewer: Siebrand <siebr...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to