Florianschmidtwelzow has uploaded a new change for review.
https://gerrit.wikimedia.org/r/183992
Change subject: Hygiene: Get rid of wfMessage where possible
......................................................................
Hygiene: Get rid of wfMessage where possible
Use of msg() functions, if they exists.
Change-Id: I643b8d737b09998022078af43be11765ef7a9d9d
---
M includes/GoogleLogin.body.php
M includes/GoogleLogin.hooks.php
M includes/specials/SpecialGoogleLogin.php
3 files changed, 21 insertions(+), 21 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/GoogleLogin
refs/changes/92/183992/1
diff --git a/includes/GoogleLogin.body.php b/includes/GoogleLogin.body.php
index 851bd04..a804f50 100644
--- a/includes/GoogleLogin.body.php
+++ b/includes/GoogleLogin.body.php
@@ -560,16 +560,16 @@
Html::element(
'label',
array( 'for' => 'wpGoogleLoginRemember'
),
- wfMessage(
'userlogin-remembermypassword' )->escaped()
+ $tpl->getMsg(
'userlogin-remembermypassword' )->escaped()
) .
Html::closeElement( 'div') .
Html::closeElement( 'div');
}
if ( $login ) {
- $buttonMsg = wfMessage( 'googlelogin' )->text();
+ $buttonMsg = $tpl->getMsg( 'googlelogin'
)->escaped();
} else {
- $buttonMsg = wfMessage( 'googlelogin-create'
)->text();
+ $buttonMsg = $tpl->getMsg( 'googlelogin-create'
)->escaped();
}
$header .=
$keepLogin .
@@ -584,7 +584,7 @@
) .
Html::closeElement( 'div' ) .
Html::openElement( 'fieldset', array( 'class'
=> 'loginSeperator' ) ) .
- Html::element( 'legend', array(), wfMessage(
'googlelogin-or' )->escaped() ) .
+ Html::element( 'legend', array(), $tpl->getMsg(
'googlelogin-or' )->escaped() ) .
Html::closeElement( 'fieldset' );
$tpl->set( 'header', $header );
diff --git a/includes/GoogleLogin.hooks.php b/includes/GoogleLogin.hooks.php
index 1ac7de0..b548d42 100644
--- a/includes/GoogleLogin.hooks.php
+++ b/includes/GoogleLogin.hooks.php
@@ -58,7 +58,7 @@
// Replace login link with GoogleLogin link
$googleLogin = new GoogleLogin;
- $personal_urls['login']['text'] = wfMessage(
'googlelogin' )->text();
+ $personal_urls['login']['text'] = $skin->msg(
'googlelogin' )->text();
$personal_urls['login']['href'] =
$googleLogin->getLoginUrl( $skin, $title );
}
}
diff --git a/includes/specials/SpecialGoogleLogin.php
b/includes/specials/SpecialGoogleLogin.php
index 009df54..32d2fb9 100644
--- a/includes/specials/SpecialGoogleLogin.php
+++ b/includes/specials/SpecialGoogleLogin.php
@@ -75,15 +75,15 @@
'Google-ID',
$userInfo['id']
),
array(
- wfMessage(
'googlelogin-googleuser' )->text(), $userInfo['displayName']
+ $this->msg(
'googlelogin-googleuser' )->text(), $userInfo['displayName']
),
array(
- wfMessage(
'googlelogin-email' )->text(), $userInfo['emails'][0]['value']
+ $this->msg(
'googlelogin-email' )->text(), $userInfo['emails'][0]['value']
),
array(
- wfMessage(
'googlelogin-linkstatus' )->text(),
- (
$googleIdExists ? wfMessage( 'googlelogin-linked' )->text() :
-
wfMessage( 'googlelogin-unlinked' )->text() )
+ $this->msg(
'googlelogin-linkstatus' )->text(),
+ (
$googleIdExists ? $this->msg( 'googlelogin-linked' )->text() :
+
$this->msg( 'googlelogin-unlinked' )->text() )
)
);
$tableAttribs = array(
@@ -91,8 +91,8 @@
);
if ( !$googleIdExists )
$this->createSubmitButton( 'Logout', 'progressive' );
$out->addHtml(
Html::openelement( 'fieldset' ) .
- Html::element(
'legend', null, wfMessage( 'googlelogin-information-title' )->text() ) .
- Html::element( 'label',
null, wfMessage( 'googlelogin-information-body' )->text() ) .
+ Html::element(
'legend', null, $this->msg( 'googlelogin-information-title' )->text() ) .
+ Html::element( 'label',
null, $this->msg( 'googlelogin-information-body' )->text() ) .
Xml::buildTable(
$buildTable, $tableAttribs ) .
Html::closeelement(
'fieldset' )
);
@@ -187,7 +187,7 @@
*/
private function createGoogleUserForm( $userInfo, $db ) {
$request = $this->getRequest();
- $this->getOutput()->setPageTitle( wfMessage(
'googlelogin-form-choosename-title' )->text() );
+ $this->getOutput()->setPageTitle( $this->msg(
'googlelogin-form-choosename-title' )->text() );
$names = array();
if ( GoogleLogin::isValidUsername(
$userInfo['displayName'] ) ) {
$names[$userInfo['displayName']] =
'wpDisplayName';
@@ -195,7 +195,7 @@
if ( GoogleLogin::isValidUsername(
$userInfo['name']['givenName'] ) ) {
$names[$userInfo['name']['givenName']] =
'wpGivenName';
}
- $names[wfMessage( 'googlelogin-form-chooseown'
)->text()] = 'wpOwn';
+ $names[$this->msg( 'googlelogin-form-chooseown'
)->text()] = 'wpOwn';
$defaultName = ($request->getVal( 'wpChooseName' ) !==
null ?
$request->getVal( 'wpChooseName' ) : 'wpOwn');
$formElements = array(
@@ -210,14 +210,14 @@
'section' => 'choosename',
'class' => 'HTMLTextField',
'default' => $request->getVal(
'wpChooseOwn' ),
- 'label' => wfMessage(
'googlelogin-form-chooseown' )->text() . ':',
- 'help' => wfMessage(
'googlelogin-form-choosename-help' )->text()
+ 'label' => $this->msg(
'googlelogin-form-chooseown' )->text() . ':',
+ 'help' => $this->msg(
'googlelogin-form-choosename-help' )->text()
),
);
$htmlForm = new HTMLForm( $formElements,
$this->getContext(), 'googlelogin-form' );
$htmlForm->addHiddenField( 'action', 'Create' );
$htmlForm->addHiddenField( 'wpSecureHash',
$this->mGoogleLogin->getRequestToken() );
- $htmlForm->setSubmitText( wfMessage(
'googlelogin-form-create' )->text() );
+ $htmlForm->setSubmitText( $this->msg(
'googlelogin-form-create' )->text() );
$htmlForm->setAction( $this->getPageTitle( 'Create'
)->getLocalUrl() );
$htmlForm->setSubmitCallback( array( 'GoogleLogin',
'submitChooseName' ) );
@@ -244,7 +244,7 @@
break;
}
- $htmlForm->setSubmitText( wfMessage(
'googlelogin-form-' . strtolower( $action ) )->text() );
+ $htmlForm->setSubmitText( $this->msg(
'googlelogin-form-' . strtolower( $action ) )->text() );
$htmlForm->addHiddenField( 'action', $action );
$htmlForm->addHiddenField( 'wpSecureHash',
$this->mGoogleLogin->getRequestToken() );
$htmlForm->setAction( $this->getPageTitle( $action
)->getLocalUrl() );
@@ -265,7 +265,7 @@
array(
'href' =>
$this->getPageTitle()->getLocalUrl()
),
- wfMessage(
'googlelogin-form-backlink' )->text()
+ $this->msg(
'googlelogin-form-backlink' )->text()
)
);
}
@@ -331,7 +331,7 @@
}
}
if ( !empty( $userName ) ) {
- $out->setPageTitle(
wfMessage( 'googlelogin-form-choosename-finish-title' )->text() );
+ $out->setPageTitle(
$this->msg( 'googlelogin-form-choosename-finish-title' )->text() );
$userParam = array(
'password' =>
md5( Rand() ),
'email' =>
$userInfo['emails'][0]['value'],
@@ -359,7 +359,7 @@
$redirectQuery
= wfCgiToArray( $returnTo['query'] );
$out->addReturnTo( $redirectTo, $redirectQuery );
} else {
-
$this->createError( wfMessage( 'googlelogin-link-other' )->text() );
+
$this->createError( $this->msg( 'googlelogin-link-other' )->text() );
}
}
} else {
--
To view, visit https://gerrit.wikimedia.org/r/183992
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I643b8d737b09998022078af43be11765ef7a9d9d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/GoogleLogin
Gerrit-Branch: master
Gerrit-Owner: Florianschmidtwelzow <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits