/** * Run hook to override a message keys that might need to be changed * across all sites in this cluster. * @param string $msgKey the Message key * @return string the Message key to use */ public static function getSiteMessage( $msgKey ) { wfRunHooks( 'OAuthReplaceMessage', &$msgKey ); return $msgKey; }
I'm not sure what value this really brings... We can override in WikimediaMessages (WikimediaMessagesHooks::onMessageCacheGet) rather than using this
$wgHooks['OAuthReplaceMessage'][] = function ( &$msgKey ) { if ( $msgKey === 'mwoauth-form-privacypolicy-link' ) { $msgKey = 'wikimedia-oauth-privacy-link'; } return true; };
I don't think this adds anything; any wiki that requires this functionality can just use MessageCache::get in almost exactly the same way
$wgHooks['MessageCache::get'][] = function ( &$msgKey ) { if ( $msgKey === 'mwoauth-form-privacypolicy-link' ) { $msgKey = 'wikimedia-oauth-privacy-link'; } return true; };