mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-09-24 02:39:33 +00:00
Bidi isolate content items in notification header text
Bug: T127407 Change-Id: I25c426f3d0190bd33c4aa1c2ffb3c97fe1424567
This commit is contained in:
parent
c25265673b
commit
9a1defa57f
|
@ -53,7 +53,7 @@ class EchoEditUserTalkPresentationModel extends EchoEventPresentationModel {
|
|||
} elseif ( $this->hasSection() ) {
|
||||
$msg = $this->getMessageWithAgent( "notification-header-{$this->type}-with-section" );
|
||||
$msg->params( $this->getViewingUserForGender() );
|
||||
$msg->params( $this->getSectionTitleSnippet() );
|
||||
$msg->params( $this->language->embedBidi( $this->getSectionTitleSnippet() ) );
|
||||
return $msg;
|
||||
} else {
|
||||
$msg = parent::getHeaderMessage();
|
||||
|
|
|
@ -245,7 +245,7 @@ abstract class EchoEventPresentationModel implements JsonSerializable {
|
|||
if ( $this->userCan( Revision::DELETED_USER ) ) {
|
||||
// Not deleted
|
||||
return array(
|
||||
$this->language->embedBidi( $this->getTruncatedUsername( $agent ) ),
|
||||
$this->getTruncatedUsername( $agent ),
|
||||
$agent->getName()
|
||||
);
|
||||
} else {
|
||||
|
@ -375,12 +375,12 @@ abstract class EchoEventPresentationModel implements JsonSerializable {
|
|||
}
|
||||
|
||||
protected function getTruncatedUsername( User $user ) {
|
||||
return $this->language->truncate( $user->getName(), self::USERNAME_RECOMMENDED_LENGTH, '...', false );
|
||||
return $this->language->embedBidi( $this->language->truncate( $user->getName(), self::USERNAME_RECOMMENDED_LENGTH, '...', false ) );
|
||||
}
|
||||
|
||||
protected function getTruncatedTitleText( Title $title, $includeNamespace = false ) {
|
||||
$text = $includeNamespace ? $title->getPrefixedText() : $title->getText();
|
||||
return $this->language->truncate( $text, self::PAGE_NAME_RECOMMENDED_LENGTH, '...', false );
|
||||
return $this->language->embedBidi( $this->language->truncate( $text, self::PAGE_NAME_RECOMMENDED_LENGTH, '...', false ) );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -65,7 +65,7 @@ class EchoMentionPresentationModel extends EchoEventPresentationModel {
|
|||
// make sure it is a user talk page but NOT the agent's talk page.
|
||||
} elseif ( $this->onUserTalkpage() ) {
|
||||
$username = $this->event->getTitle()->getText();
|
||||
$msg->params( $this->language->truncate( $username, self::USERNAME_RECOMMENDED_LENGTH, '...', false ) );
|
||||
$msg->params( $this->getTruncatedUsername() );
|
||||
$msg->params( $username );
|
||||
} else {
|
||||
$msg->params( $this->getTruncatedTitleText( $this->event->getTitle(), true ) );
|
||||
|
@ -73,13 +73,13 @@ class EchoMentionPresentationModel extends EchoEventPresentationModel {
|
|||
|
||||
$section = $this->getSection();
|
||||
if ( $section ) {
|
||||
$msg->params(
|
||||
$msg->params( $this->language->bidiEmbed(
|
||||
EchoDiscussionParser::getTextSnippet(
|
||||
$section,
|
||||
$this->language,
|
||||
self::SECTION_TITLE_RECOMMENDED_LENGTH
|
||||
)
|
||||
);
|
||||
) );
|
||||
}
|
||||
|
||||
return $msg;
|
||||
|
|
|
@ -11,8 +11,14 @@ class EchoUserRightsPresentationModel extends EchoEventPresentationModel {
|
|||
|
||||
public function getHeaderMessage() {
|
||||
list( $formattedName, $genderName ) = $this->getAgentForOutput();
|
||||
$add = $this->getLocalizedGroupNames( array_values( $this->event->getExtraParam( 'add', array() ) ) );
|
||||
$remove = $this->getLocalizedGroupNames( array_values( $this->event->getExtraParam( 'remove', array() ) ) );
|
||||
$add = array_map(
|
||||
array( $this->language, 'embedBidi' ),
|
||||
$this->getLocalizedGroupNames( array_values( $this->event->getExtraParam( 'add', array() ) ) )
|
||||
);
|
||||
$remove = array_map(
|
||||
array( $this->language, 'embedBidi' ),
|
||||
$this->getLocalizedGroupNames( array_values( $this->event->getExtraParam( 'remove', array() ) ) )
|
||||
);
|
||||
if ( $add && !$remove ) {
|
||||
$msg = $this->msg( 'notification-header-user-rights-add-only' );
|
||||
$msg->params( $genderName );
|
||||
|
|
Loading…
Reference in a new issue