Index: trunk/extensions/LiquidThreads/classes/NewMessagesController.php |
— | — | @@ -225,9 +225,9 @@ |
226 | 226 | |
227 | 227 | while( $row = $dbr->fetchObject( $res ) ) { |
228 | 228 | $u = User::newFromRow( $row ); |
| 229 | + $lang = Language::factory( $u->getOption( 'language' ) ); |
| 230 | + $langCode = $lang->getCode(); |
229 | 231 | |
230 | | - global $wgLang; |
231 | | - |
232 | 232 | $permalink = LqtView::permalinkUrl( $t ); |
233 | 233 | |
234 | 234 | // Adjust with time correction |
— | — | @@ -237,20 +237,26 @@ |
238 | 238 | } else { |
239 | 239 | $timeCorrection = $row->up_value; |
240 | 240 | } |
241 | | - $adjustedTimestamp = $wgLang->userAdjust( $timestamp, $timeCorrection ); |
| 241 | + $adjustedTimestamp = $lang->userAdjust( $timestamp, $timeCorrection ); |
242 | 242 | |
243 | | - $date = $wgLang->date( $adjustedTimestamp ); |
244 | | - $time = $wgLang->time( $adjustedTimestamp ); |
| 243 | + $date = $lang->date( $adjustedTimestamp ); |
| 244 | + $time = $lang->time( $adjustedTimestamp ); |
245 | 245 | |
246 | 246 | $talkPage = $t->article()->getTitle()->getPrefixedText(); |
247 | | - $msg = wfMsg( $msgName, $u->getName(), $t->subjectWithoutIncrement(), |
| 247 | + $params = array( $u->getName(), $t->subjectWithoutIncrement(), |
248 | 248 | $date, $time, $talkPage, $permalink ); |
| 249 | + |
| 250 | + // Get message in user's own language, bug 20645 |
| 251 | + $msg = wfMsgReal( $msgName, $params, true /* use DB */, $langCode, |
| 252 | + true /*transform*/ ); |
249 | 253 | |
250 | 254 | global $wgPasswordSender; |
251 | 255 | |
252 | 256 | $from = new MailAddress( $wgPasswordSender, 'WikiAdmin' ); |
253 | 257 | $to = new MailAddress( $u ); |
254 | | - $subject = wfMsgExt( $subjectMsg, 'parsemag', $t->subjectWithoutIncrement() ); |
| 258 | + $threadSubject = $t->subject(); |
| 259 | + $subject = wfMsgReal( $subjectMsg, array($threadSubject), true /* use DB */, |
| 260 | + $langCode, true /* transform */); |
255 | 261 | |
256 | 262 | UserMailer::send( $to, $from, $subject, $msg ); |
257 | 263 | } |