Index: trunk/extensions/Reviews/includes/ReviewPager.php |
— | — | @@ -128,7 +128,7 @@ |
129 | 129 | */ |
130 | 130 | function formatRow( $row ) { |
131 | 131 | $this->currentReview = Review::newFromDBResult( $row ); |
132 | | - return '<tr><td>' . $this->currentReview->getHTML( $this->getUser() ) . '</td></tr>'; |
| 132 | + return '<tr><td>' . $this->currentReview->getHTML( $this->getUser(), $this->getLanguage() ) . '</td></tr>'; |
133 | 133 | } |
134 | 134 | |
135 | 135 | /** |
Index: trunk/extensions/Reviews/includes/ReviewsList.php |
— | — | @@ -88,7 +88,8 @@ |
89 | 89 | $reviews = $this->getReviews( $source->getTitle() ); |
90 | 90 | |
91 | 91 | if ( count( $reviews ) > 0 ) { |
92 | | - return $this->getList( $reviews, $source->getUser() ); |
| 92 | + $lang = method_exists( $source, 'getLanguage' ) ? $source->getLanguage() : $GLOBALS['wgLang']; |
| 93 | + return $this->getList( $reviews, $source->getUser(), $lang ); |
93 | 94 | } |
94 | 95 | else { |
95 | 96 | return is_null( $this->contents['default'] ) ? '' : $this->contents['default']; |
— | — | @@ -155,14 +156,16 @@ |
156 | 157 | * @since 0.1 |
157 | 158 | * |
158 | 159 | * @param array $reviews |
| 160 | + * @param User $user |
| 161 | + * @param Language $lang |
159 | 162 | * |
160 | 163 | * @return string |
161 | 164 | */ |
162 | | - protected function getList( array /* of Review */ $reviews, User $user ) { |
| 165 | + protected function getList( array /* of Review */ $reviews, User $user, Language $lang ) { |
163 | 166 | $html = ''; |
164 | 167 | |
165 | 168 | foreach ( $reviews as /* Review */ $review ) { |
166 | | - $html .= $review->getHTML( $user ); |
| 169 | + $html .= $review->getHTML( $user, $lang ); |
167 | 170 | } |
168 | 171 | |
169 | 172 | return $html; |
Index: trunk/extensions/Reviews/includes/Review.php |
— | — | @@ -351,9 +351,12 @@ |
352 | 352 | * |
353 | 353 | * @since 0.1 |
354 | 354 | * |
| 355 | + * @param User $user |
| 356 | + * @param Language $lang |
| 357 | + * |
355 | 358 | * @return string |
356 | 359 | */ |
357 | | - public function getHTML( User $user ) { |
| 360 | + public function getHTML( User $user, Language $lang ) { |
358 | 361 | $ratings = $this->getRatings( true ); |
359 | 362 | |
360 | 363 | $html = '<table class="review-table">'; |
— | — | @@ -375,7 +378,7 @@ |
376 | 379 | $html .= Html::element( 'p', array( 'class' => 'reviews-posted-on' ), wfMsgExt( |
377 | 380 | 'reviews-posted-on', |
378 | 381 | 'parsemag', |
379 | | - $this->getField( 'post_time' ) |
| 382 | + $lang->date( $this->getField( 'post_time' ), true ) |
380 | 383 | ) ); |
381 | 384 | |
382 | 385 | $html .= '</td>'; |
Index: trunk/extensions/Reviews/Reviews.hooks.php |
— | — | @@ -169,7 +169,7 @@ |
170 | 170 | */ |
171 | 171 | public static function onBeforePageDisplay( OutputPage &$out, Skin &$skin ) { |
172 | 172 | if ( property_exists( $out, 'reviewsMagicWord' ) && $out->reviewsMagicWord ) { |
173 | | - $tag = new ReviewsTag(); |
| 173 | + $tag = new ReviewsList(); |
174 | 174 | $out->addHTML( $tag->render( $out ) ); |
175 | 175 | |
176 | 176 | /* User */ $user = $out->getUser(); |