r87815 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r87814‎ | r87815 | r87816 >
Date:11:02, 10 May 2011
Author:faurethomas
Status:deferred
Tags:
Comment:
fix r87811 using wfMsgExt
Modified paths:
  • /trunk/extensions/WikiTweet/WikiTweet.functions.php (modified) (history)
  • /trunk/extensions/WikiTweet/WikiTweet.i18n.php (modified) (history)

Diff [purge]

Index: trunk/extensions/WikiTweet/WikiTweet.i18n.php
@@ -30,7 +30,7 @@
3131 'wikitweet-tweets-tagged' => 'Tweets tagged',
3232 'wikitweet-back-timeline' => 'Back to the timeline',
3333 'wikitweet-tweets-from-room' => 'Tweets from room',
34 - 'wikitweet-timeago' => '%time% ago', // Do not translate the string "%time%", it is a keyword
 34+ 'wikitweet-timeago' => '$1 ago',
3535 'wikitweet-hour' => 'hour',
3636 'wikitweet-hours' => 'hours',
3737 'wikitweet-minute' => 'minute',
@@ -101,7 +101,7 @@
102102 'wikitweet-tweets-tagged' => 'Tweets taggés',
103103 'wikitweet-back-timeline' => 'Retour au flux',
104104 'wikitweet-tweets-from-room' => 'Tweets de la room',
105 - 'wikitweet-timeago' => 'Il y a %time%',
 105+ 'wikitweet-timeago' => 'Il y a $1',
106106 'wikitweet-hour' => 'heure',
107107 'wikitweet-hours' => 'heures',
108108 'wikitweet-minute' => 'minute',
Index: trunk/extensions/WikiTweet/WikiTweet.functions.php
@@ -113,24 +113,24 @@
114114
115115 if ($l__nber_hours !=0 && $l__nber_minutes != 0 )
116116 {
117 - $result = str_replace( "%time%" , "$l__nber_hours $hours $l__nber_minutes $minutes" , wfMsg( 'wikitweet-timeago' ) ); // "%time% ago"
 117+ $result = wfMsgExt( 'wikitweet-timeago', 'parse', "$l__nber_hours $hours $l__nber_minutes $minutes" );
118118 }
119119 elseif (($l__nber_hours != 0 && $l__nber_minutes == 0 ) || ($l__nber_hours >= 5 ) )
120120 {
121 - $result = str_replace( "%time%" , "$l__nber_hours $hours" , wfMsg( 'wikitweet-timeago' ) ); // "%time% ago"
 121+ $result = wfMsgExt( 'wikitweet-timeago', 'parse', "$l__nber_hours $hours" );
122122 }
123123 elseif (($l__nber_minutes >= 5) || ($l__nber_minutes != 0 && $l__nber_seconds == 0 ) )
124124 {
125 - $result = str_replace( "%time%" , "$l__nber_minutes $minutes" , wfMsg( 'wikitweet-timeago' ) ); // "%time% ago"
 125+ $result = wfMsgExt( 'wikitweet-timeago', 'parse', "$l__nber_minutes $minutes" );
126126 }
127127 elseif ($l__nber_minutes != 0 && $l__nber_seconds != 0 )
128128 {
129 - $result = str_replace( "%time%" , "$l__nber_minutes $minutes $l__nber_seconds $seconds" , wfMsg( 'wikitweet-timeago' ) ); // "%time% ago"
 129+ $result = wfMsgExt( 'wikitweet-timeago', 'parse', "$l__nber_minutes $minutes $l__nber_seconds $seconds" );
130130 }
131131 elseif ($l__nber_seconds !=0 )
132132 {
133 - $result = str_replace( "%time%" , "$l__nber_seconds $seconds" , wfMsg( 'wikitweet-timeago' ) ); // "%time% ago"
 133+ $result = wfMsgExt( 'wikitweet-timeago', 'parse', "$l__nber_seconds $seconds" );
134134 }
135 - return $result ; // a string
 135+ return $result ;
136136 }
137137 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r87811Add a function to convert a tweet timestamp in a countdown. Include the func...faurethomas08:56, 10 May 2011

Status & tagging log