*
* @file
*/
+use MediaWiki\MediaWikiServices;
/**
* CommentStoreComment represents a comment stored by CommentStore. The fields
* @return CommentStoreComment
*/
public static function newUnsavedComment( $comment, array $data = null ) {
- global $wgContLang;
-
if ( $comment instanceof CommentStoreComment ) {
return $comment;
}
if ( $comment instanceof Message ) {
$message = clone $comment;
- $text = $message->inLanguage( $wgContLang ) // Avoid $wgForceUIMsgAsContentMsg
+ // Avoid $wgForceUIMsgAsContentMsg
+ $text = $message->inLanguage( MediaWikiServices::getInstance()->getContentLanguage() )
->setInterfaceMessageFlag( true )
->text();
return new CommentStoreComment( null, $text, $message, $data );