Directly use Language::factory instead of wfGetLangObj

Other places like Message::inLanguage also use
Language::factory( $user->getOption( 'language' ) ).

Change-Id: I911dc2319e1922276daa3eb3614a350c80b8b57f
This commit is contained in:
Fomafix 2018-06-05 10:15:37 +02:00
parent d0714b2928
commit 99173922c1
2 changed files with 2 additions and 2 deletions

View file

@ -43,7 +43,7 @@ class MWEchoEmailBatch {
*/
public function __construct( User $user ) {
$this->mUser = $user;
$this->language = wfGetLangObj( $this->mUser->getOption( 'language' ) );
$this->language = Language::factory( $this->mUser->getOption( 'language' ) );
}
/**

View file

@ -108,7 +108,7 @@ class EchoNotifier {
*/
private static function generateEmail( EchoEvent $event, User $user ) {
$emailFormat = MWEchoNotifUser::newFromUser( $user )->getEmailFormat();
$lang = wfGetLangObj( $user->getOption( 'language' ) );
$lang = Language::factory( $user->getOption( 'language' ) );
$formatter = new EchoPlainTextEmailFormatter( $user, $lang );
$content = $formatter->format( $event );
if ( !$content ) {