Matthias Mullie has uploaded a new change for review.
https://gerrit.wikimedia.org/r/93723
Change subject: Fix moderation usertext (messages had been overtaken by History
......................................................................
Fix moderation usertext (messages had been overtaken by History
Meanwhile removed obsolete flow-post-hidden, flow-post-deleted &
flow-post-censored messages
Change-Id: I523abd29ba1e6814f3c9edec453145849ba25112
---
M Flow.i18n.php
M includes/Model/AbstractRevision.php
2 files changed, 22 insertions(+), 18 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow
refs/changes/23/93723/1
diff --git a/Flow.i18n.php b/Flow.i18n.php
index 5f8217b..7752693 100644
--- a/Flow.i18n.php
+++ b/Flow.i18n.php
@@ -25,11 +25,11 @@
'flow-post-moderated-toggle-show' => '[Show]',
'flow-post-moderated-toggle-hide' => '[Hide]',
- 'flow-post-hidden' => '[post hidden]',
+ 'flow-post-hidden-usertext' => '$1',
'flow-post-hidden-by' => '{{GENDER:$1|Hidden}} by $1 $2',
- 'flow-post-deleted' => '[post deleted]',
+ 'flow-post-deleted-usertext' => '$1',
'flow-post-deleted-by' => '{{GENDER:$1|Deleted}} by $1 $2',
- 'flow-post-censored' => '[post censored]',
+ 'flow-post-censored-usertext' => '[Censored]',
'flow-post-censored-by' => '{{GENDER:$1|Censored}} by $1 $2',
'flow-post-actions' => 'Actions',
'flow-topic-actions' => 'Actions',
@@ -227,9 +227,10 @@
'flow-header-empty' => 'Used as a placeholder text for headers which
have no content.',
'flow-post-moderated-toggle-show' => 'Text for link used to display a
moderated post',
'flow-post-moderated-toggle-hide' => 'Text for link used to hide a
moderated post',
- 'flow-post-hidden' => 'Used as username/content if the post was hidden.
+ 'flow-post-hidden-usertext' => 'Used as username if the post was hidden.
-Translate this as "post which was hidden".',
+Parameters:
+* $1 - Username of the post creator. Can be used for GENDER',
'flow-post-hidden-by' => 'Parameters:
* $1 - username that hid the post, can be used for GENDER
* $2 - timestamp, relative to post creation date, of when the post was hidden.
Any one of the following:
@@ -238,9 +239,10 @@
** {{msg-mw|Sunday-at}}, {{msg-mw|Monday-at}}, {{msg-mw|Tuesday-at}}, ...
** {{msg-mw|Yesterday-at}}, {{msg-mw|Today-at}}
{{Related|Flow-post-by}}',
- 'flow-post-deleted' => 'Used as username/content if the post was
deleted.
+ 'flow-post-deleted-usertext' => 'Used as username if the post was
deleted.
-Translate this as "post which was deleted".',
+Parameters:
+* $1 - Username of the post creator. Can be used for GENDER',
'flow-post-deleted-by' => 'Parameters:
* $1 - username that deleted the post, can be used for GENDER
* $2 - timestamp, relative to post creation date, of when the post was
deleted. Any one of the following:
@@ -249,9 +251,10 @@
** {{msg-mw|Sunday-at}}, {{msg-mw|Monday-at}}, {{msg-mw|Tuesday-at}}, ...
** {{msg-mw|Yesterday-at}}, {{msg-mw|Today-at}}
{{Related|Flow-post-by}}',
- 'flow-post-censored' => 'Used as username/content if the post was
censored.
+ 'flow-post-censored-usertext' => 'Used as username if the post was
censored.
-Translate this as "post which was censored".',
+Parameters:
+* $1 - Username of the post creator. Can be used for GENDER',
'flow-post-censored-by' => 'Parameters:
* $1 - username that censored the post, can be used for GENDER
* $2 - timestamp, relative to post creation date, of when the post was
censored. Any one of the following:
diff --git a/includes/Model/AbstractRevision.php
b/includes/Model/AbstractRevision.php
index 69bd811..2a9a7fb 100644
--- a/includes/Model/AbstractRevision.php
+++ b/includes/Model/AbstractRevision.php
@@ -36,7 +36,7 @@
// NOTE: special case self::getHiddenContent still
retrieves content in this case only
'content' => 'flow-post-hidden-by',
// This is the bit of text rendered instead of the post
creator
- 'usertext' => 'flow-rev-message-hid-post', // @todo:
message has changed
+ 'usertext' => 'flow-post-hidden-usertext',
// Whether or not to create a new revision when setting
this state
'new-revision' => true,
// i18n key for history and recentchanges
@@ -48,7 +48,7 @@
// i18n key to replace content with when state is active
'content' => 'flow-post-deleted-by',
// This is the bit of text rendered instead of the post
creator
- 'usertext' => 'flow-rev-message-deleted-post', //
@todo: message has changed
+ 'usertext' => 'flow-post-deleted-usertext',
// Whether or not to create a new revision when setting
this state
'new-revision' => false,
// i18n key for history and recentchanges
@@ -60,7 +60,7 @@
// i18n key to replace content with when state is active
'content' => 'flow-post-censored-by',
// This is the bit of text rendered instead of the post
creator
- 'usertext' => 'flow-rev-message-censored-post', //
@todo: message has changed
+ 'usertext' => 'flow-post-censored-usertext',
// Whether or not to create a new revision when setting
this state
'new-revision' => false,
// i18n key for history and recentchanges
@@ -323,13 +323,14 @@
}
public function getUserText( $user = null ) {
- // The text of *this* revision is only stripped when fully
moderated
- if ( $this->isCensored() ) {
- // Messages: flow-post-hidden, flow-post-deleted,
flow-post-censored
- return wfMessage(
self::$perms[$this->moderationState]['usertext'] );
- } else {
- return $this->getUserTextRaw();
+ $username = $this->getUserTextRaw();
+
+ if ( isset( self::$perms[$this->moderationState]['usertext'] )
) {
+ // Messages: flow-post-hidden-usertext,
flow-post-deleted-usertext, flow-post-censored-usertext
+ return wfMessage(
self::$perms[$this->moderationState]['usertext'], $username );
}
+
+ return $username;
}
public function getUserTextRaw() {
--
To view, visit https://gerrit.wikimedia.org/r/93723
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I523abd29ba1e6814f3c9edec453145849ba25112
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Matthias Mullie <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits