Index: trunk/extensions/WikiTweet/WikiTweet.i18n.php |
— | — | @@ -29,14 +29,8 @@ |
30 | 30 | 'wikitweet-anonymous' => 'anonymous', |
31 | 31 | 'wikitweet-tweets-tagged' => 'Tweets tagged', |
32 | 32 | 'wikitweet-back-timeline' => 'Back to the timeline', |
33 | | - 'wikitweet-tweets-from-room' => 'Tweets from room', |
| 33 | + 'wikitweet-tweets-from-room' => 'Tweets from room', |
34 | 34 | 'wikitweet-timeago' => '$1 ago', |
35 | | - 'wikitweet-hour' => 'hour', |
36 | | - 'wikitweet-hours' => 'hours', |
37 | | - 'wikitweet-minute' => 'minute', |
38 | | - 'wikitweet-minutes' => 'minutes', |
39 | | - 'wikitweet-second' => 'second', |
40 | | - 'wikitweet-seconds' => 'seconds', |
41 | 35 | 'wikitweet-inthefuture' => 'In the future !!', |
42 | 36 | 'wikitweet-fewsecondsago' => 'Few seconds ago' |
43 | 37 | ); |
— | — | @@ -102,12 +96,6 @@ |
103 | 97 | 'wikitweet-back-timeline' => 'Retour au flux', |
104 | 98 | 'wikitweet-tweets-from-room' => 'Tweets de la room', |
105 | 99 | 'wikitweet-timeago' => 'Il y a $1', |
106 | | - 'wikitweet-hour' => 'heure', |
107 | | - 'wikitweet-hours' => 'heures', |
108 | | - 'wikitweet-minute' => 'minute', |
109 | | - 'wikitweet-minutes' => 'minutes', |
110 | | - 'wikitweet-second' => 'seconde', |
111 | | - 'wikitweet-seconds' => 'secondes', |
112 | 100 | 'wikitweet-inthefuture' => 'Dans le futur !!', |
113 | 101 | 'wikitweet-fewsecondsago' => 'Il y a quelques secondes' |
114 | 102 | ); |
Index: trunk/extensions/WikiTweet/WikiTweet.functions.php |
— | — | @@ -88,49 +88,12 @@ |
89 | 89 | // less than 10 seconds is "few" |
90 | 90 | $result = wfMsg ( 'wikitweet-fewsecondsago' ) ; |
91 | 91 | } |
92 | | - elseif ( $l__diff_date >= 60 ) |
93 | | - { |
94 | | - // real conversion |
95 | | - $l__nber_seconds = $l__diff_date % 60 ; |
96 | | - $l__new_diff = $l__diff_date - $l__nber_seconds ; |
97 | | - $l__nber_minutes = $l__new_diff / 60 ; |
98 | | - if ($l__nber_minutes >= 60) |
99 | | - { |
100 | | - $l__old_nber_minutes = $l__nber_minutes ; |
101 | | - $l__nber_minutes = $l__nber_minutes % 60 ; |
102 | | - $l__new_nber_minutes = $l__old_nber_minutes - $l__nber_minutes ; |
103 | | - $l__nber_hours = $l__new_nber_minutes / 60 ; |
104 | | - } |
105 | | - } |
106 | 92 | else |
107 | 93 | { |
108 | | - $l__nber_seconds = $l__diff_date ; |
| 94 | + $languageobject = new Language(); |
| 95 | + $date_to_display = $languageobject->formatTimePeriod(time()-strtotime($dateSrc)); |
| 96 | + $result = wfMsgExt( 'wikitweet-timeago', 'parse', $date_to_display ); |
109 | 97 | } |
110 | | - //plurals |
111 | | - $seconds = ( $l__nber_seconds == 1 ) ? wfMsg( 'wikitweet-second' ) : wfMsg( 'wikitweet-seconds' ) ; |
112 | | - $minutes = ( $l__nber_minutes == 1 ) ? wfMsg( 'wikitweet-minute' ) : wfMsg( 'wikitweet-minutes' ) ; |
113 | | - $hours = ( $l__nber_hours == 1 ) ? wfMsg( 'wikitweet-hour' ) : wfMsg( 'wikitweet-hours' ) ; |
114 | | - |
115 | | - if ($l__nber_hours !=0 && $l__nber_minutes != 0 ) |
116 | | - { |
117 | | - $result = wfMsgExt( 'wikitweet-timeago', 'parse', "$l__nber_hours $hours $l__nber_minutes $minutes" ); |
118 | | - } |
119 | | - elseif (($l__nber_hours != 0 && $l__nber_minutes == 0 ) || ($l__nber_hours >= 5 ) ) |
120 | | - { |
121 | | - $result = wfMsgExt( 'wikitweet-timeago', 'parse', "$l__nber_hours $hours" ); |
122 | | - } |
123 | | - elseif (($l__nber_minutes >= 5) || ($l__nber_minutes != 0 && $l__nber_seconds == 0 ) ) |
124 | | - { |
125 | | - $result = wfMsgExt( 'wikitweet-timeago', 'parse', "$l__nber_minutes $minutes" ); |
126 | | - } |
127 | | - elseif ($l__nber_minutes != 0 && $l__nber_seconds != 0 ) |
128 | | - { |
129 | | - $result = wfMsgExt( 'wikitweet-timeago', 'parse', "$l__nber_minutes $minutes $l__nber_seconds $seconds" ); |
130 | | - } |
131 | | - elseif ($l__nber_seconds !=0 ) |
132 | | - { |
133 | | - $result = wfMsgExt( 'wikitweet-timeago', 'parse', "$l__nber_seconds $seconds" ); |
134 | | - } |
135 | 98 | return $result ; |
136 | 99 | } |
137 | 100 | } |