[MediaWiki-commits] [Gerrit] mediawiki/core[master]: List grant codenames next to grants on Special:ListGrants
jenkins-bot has submitted this change and it was merged. Change subject: List grant codenames next to grants on Special:ListGrants .. List grant codenames next to grants on Special:ListGrants Bug: T145351 Change-Id: Ia07de6269fa6192071aaea5d750362685389001c --- M includes/specials/SpecialListgrants.php M includes/user/User.php M languages/i18n/en.json M languages/i18n/qqq.json 4 files changed, 23 insertions(+), 2 deletions(-) Approvals: Florianschmidtwelzow: Looks good to me, approved D3r1ck01: Looks good to me, but someone else must approve jenkins-bot: Verified diff --git a/includes/specials/SpecialListgrants.php b/includes/specials/SpecialListgrants.php index 39c8ae8..2c92410 100644 --- a/includes/specials/SpecialListgrants.php +++ b/includes/specials/SpecialListgrants.php @@ -71,8 +71,14 @@ $id = \Sanitizer::escapeId( $grant ); $out->addHTML( \Html::rawElement( 'tr', [ 'id' => $id ], - "" . $this->msg( "grant-$grant" )->escaped() . "" . - "" . $grantCellHtml . '' + "" . + $this->msg( + "listgrants-grant-display", + \User::getGrantName( $grant ), + "" . $id . "" + )->parse() . + "" . + "" . $grantCellHtml . "" ) ); } diff --git a/includes/user/User.php b/includes/user/User.php index 82d8806..b6a64b0 100644 --- a/includes/user/User.php +++ b/includes/user/User.php @@ -5076,6 +5076,19 @@ } /** +* Get the name of a given grant +* +* @since 1.29 +* @param string $grant Grant to query +* @return string Localized name of the grant +*/ + public static function getGrantName( $grant ) { + $key = "grant-$grant"; + $msg = wfMessage( $key ); + return $msg->isDisabled() ? $grant : $msg->text(); + } + + /** * Make a new-style password hash * * @param string $password Plain-text password diff --git a/languages/i18n/en.json b/languages/i18n/en.json index 9aa0f46..0b85a4b 100644 --- a/languages/i18n/en.json +++ b/languages/i18n/en.json @@ -2023,6 +2023,7 @@ "listgrants-summary": "The following is a list of grants with their associated access to user rights. Users can authorize applications to use their account, but with limited permissions based on the grants the user gave to the application. An application acting on behalf of a user cannot actually use rights that the user does not have however.\nThere may be [[{{MediaWiki:Listgrouprights-helppage}}|additional information]] about individual rights.", "listgrants-grant": "Grant", "listgrants-rights": "Rights", + "listgrants-grant-display": "$1 ($2)", "trackingcategories": "Tracking categories", "trackingcategories-summary": "This page lists tracking categories which are automatically populated by the MediaWiki software. Their names can be changed by altering the relevant system messages in the {{ns:8}} namespace.", "trackingcategories-msg": "Tracking category", diff --git a/languages/i18n/qqq.json b/languages/i18n/qqq.json index 7327012..9a1cd65 100644 --- a/languages/i18n/qqq.json +++ b/languages/i18n/qqq.json @@ -2207,6 +2207,7 @@ "listgrants-summary": "Explanatory text shown at the top of the grant/rights mapping table.\n\nRefers to {{msg-mw|Listgrouprights-helppage}}.", "listgrants-grant": "Used as table header for the grant/rights mapping table.\n{{Identical|Grant}}", "listgrants-rights": "Used as table header for the grant/rights mapping table.\n{{Identical|Right}}", + "listgrants-grant-display": "{{optional}}\nUsed to display the code name of a grant next to the grant. Parameters:\n* $1 - the text from the \"grant-...\" messages, i.e. {{msg-mw|Grant-highvolume}}\n* $2 - the codename of this grant", "trackingcategories": "[[Special:TrackingCategories]] page implementing list of Tracking categories [[mw:Special:MyLanguage/Help:Tracking categories|tracking category]].\n{{Identical|Tracking category}}", "trackingcategories-summary": "Description for [[Special:TrackingCategories]] page [[mw:Help:Tracking categories|tracking category]]", "trackingcategories-msg": "Header for the message column of the table on [[Special:TrackingCategories]]. This column lists the mediawiki message that controls the tracking category in question.\n{{Identical|Tracking category}}", -- To view, visit https://gerrit.wikimedia.org/r/324151 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType:
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: List grant codenames next to grants on Special:ListGrants
MtDu has uploaded a new change for review. https://gerrit.wikimedia.org/r/324151 Change subject: List grant codenames next to grants on Special:ListGrants .. List grant codenames next to grants on Special:ListGrants Bug: T145351 Change-Id: Ia07de6269fa6192071aaea5d750362685389001c --- M includes/specials/SpecialListgrants.php M includes/user/User.php M languages/i18n/en.json M languages/i18n/qqq.json 4 files changed, 22 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/51/324151/1 diff --git a/includes/specials/SpecialListgrants.php b/includes/specials/SpecialListgrants.php index 39c8ae8..2c92410 100644 --- a/includes/specials/SpecialListgrants.php +++ b/includes/specials/SpecialListgrants.php @@ -71,8 +71,14 @@ $id = \Sanitizer::escapeId( $grant ); $out->addHTML( \Html::rawElement( 'tr', [ 'id' => $id ], - "" . $this->msg( "grant-$grant" )->escaped() . "" . - "" . $grantCellHtml . '' + "" . + $this->msg( + "listgrants-grant-display", + \User::getGrantName( $grant ), + "" . $id . "" + )->parse() . + "" . + "" . $grantCellHtml . "" ) ); } diff --git a/includes/user/User.php b/includes/user/User.php index 82d8806..99bedd7 100644 --- a/includes/user/User.php +++ b/includes/user/User.php @@ -5076,6 +5076,18 @@ } /** +* Get the name of a given grant +* +* @param string $grant Grant to query +* @return string Localized name of the grant +*/ + public static function getGrantName( $grant ) { + $key = "grant-$grant"; + $msg = wfMessage( $key ); + return $msg->isBlank() ? $grant : $msg->text(); + } + + /** * Make a new-style password hash * * @param string $password Plain-text password diff --git a/languages/i18n/en.json b/languages/i18n/en.json index 9aa0f46..0b85a4b 100644 --- a/languages/i18n/en.json +++ b/languages/i18n/en.json @@ -2023,6 +2023,7 @@ "listgrants-summary": "The following is a list of grants with their associated access to user rights. Users can authorize applications to use their account, but with limited permissions based on the grants the user gave to the application. An application acting on behalf of a user cannot actually use rights that the user does not have however.\nThere may be [[{{MediaWiki:Listgrouprights-helppage}}|additional information]] about individual rights.", "listgrants-grant": "Grant", "listgrants-rights": "Rights", + "listgrants-grant-display": "$1 ($2)", "trackingcategories": "Tracking categories", "trackingcategories-summary": "This page lists tracking categories which are automatically populated by the MediaWiki software. Their names can be changed by altering the relevant system messages in the {{ns:8}} namespace.", "trackingcategories-msg": "Tracking category", diff --git a/languages/i18n/qqq.json b/languages/i18n/qqq.json index 7327012..9a1cd65 100644 --- a/languages/i18n/qqq.json +++ b/languages/i18n/qqq.json @@ -2207,6 +2207,7 @@ "listgrants-summary": "Explanatory text shown at the top of the grant/rights mapping table.\n\nRefers to {{msg-mw|Listgrouprights-helppage}}.", "listgrants-grant": "Used as table header for the grant/rights mapping table.\n{{Identical|Grant}}", "listgrants-rights": "Used as table header for the grant/rights mapping table.\n{{Identical|Right}}", + "listgrants-grant-display": "{{optional}}\nUsed to display the code name of a grant next to the grant. Parameters:\n* $1 - the text from the \"grant-...\" messages, i.e. {{msg-mw|Grant-highvolume}}\n* $2 - the codename of this grant", "trackingcategories": "[[Special:TrackingCategories]] page implementing list of Tracking categories [[mw:Special:MyLanguage/Help:Tracking categories|tracking category]].\n{{Identical|Tracking category}}", "trackingcategories-summary": "Description for [[Special:TrackingCategories]] page [[mw:Help:Tracking categories|tracking category]]", "trackingcategories-msg": "Header for the message column of the table on [[Special:TrackingCategories]]. This column lists the mediawiki message that controls the tracking category in question.\n{{Identical|Tracking category}}", -- To view, visit https://gerrit.wikimedia.org/r/324151 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id:
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: List grant codenames next to grants on Special:ListGrants
MtDu has uploaded a new change for review. https://gerrit.wikimedia.org/r/323993 Change subject: List grant codenames next to grants on Special:ListGrants .. List grant codenames next to grants on Special:ListGrants Bug: T145351 Change-Id: Id7fdf5a69536f7b903475c22389359f12ad2efee --- M includes/specials/SpecialListgrants.php M includes/user/User.php M languages/i18n/en.json M languages/i18n/qqq.json 4 files changed, 22 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/93/323993/1 diff --git a/includes/specials/SpecialListgrants.php b/includes/specials/SpecialListgrants.php index 39c8ae8..2c92410 100644 --- a/includes/specials/SpecialListgrants.php +++ b/includes/specials/SpecialListgrants.php @@ -71,8 +71,14 @@ $id = \Sanitizer::escapeId( $grant ); $out->addHTML( \Html::rawElement( 'tr', [ 'id' => $id ], - "" . $this->msg( "grant-$grant" )->escaped() . "" . - "" . $grantCellHtml . '' + "" . + $this->msg( + "listgrants-grant-display", + \User::getGrantName( $grant ), + "" . $id . "" + )->parse() . + "" . + "" . $grantCellHtml . "" ) ); } diff --git a/includes/user/User.php b/includes/user/User.php index 82d8806..99bedd7 100644 --- a/includes/user/User.php +++ b/includes/user/User.php @@ -5076,6 +5076,18 @@ } /** +* Get the name of a given grant +* +* @param string $grant Grant to query +* @return string Localized name of the grant +*/ + public static function getGrantName( $grant ) { + $key = "grant-$grant"; + $msg = wfMessage( $key ); + return $msg->isBlank() ? $grant : $msg->text(); + } + + /** * Make a new-style password hash * * @param string $password Plain-text password diff --git a/languages/i18n/en.json b/languages/i18n/en.json index 9aa0f46..0b85a4b 100644 --- a/languages/i18n/en.json +++ b/languages/i18n/en.json @@ -2023,6 +2023,7 @@ "listgrants-summary": "The following is a list of grants with their associated access to user rights. Users can authorize applications to use their account, but with limited permissions based on the grants the user gave to the application. An application acting on behalf of a user cannot actually use rights that the user does not have however.\nThere may be [[{{MediaWiki:Listgrouprights-helppage}}|additional information]] about individual rights.", "listgrants-grant": "Grant", "listgrants-rights": "Rights", + "listgrants-grant-display": "$1 ($2)", "trackingcategories": "Tracking categories", "trackingcategories-summary": "This page lists tracking categories which are automatically populated by the MediaWiki software. Their names can be changed by altering the relevant system messages in the {{ns:8}} namespace.", "trackingcategories-msg": "Tracking category", diff --git a/languages/i18n/qqq.json b/languages/i18n/qqq.json index 7327012..9a1cd65 100644 --- a/languages/i18n/qqq.json +++ b/languages/i18n/qqq.json @@ -2207,6 +2207,7 @@ "listgrants-summary": "Explanatory text shown at the top of the grant/rights mapping table.\n\nRefers to {{msg-mw|Listgrouprights-helppage}}.", "listgrants-grant": "Used as table header for the grant/rights mapping table.\n{{Identical|Grant}}", "listgrants-rights": "Used as table header for the grant/rights mapping table.\n{{Identical|Right}}", + "listgrants-grant-display": "{{optional}}\nUsed to display the code name of a grant next to the grant. Parameters:\n* $1 - the text from the \"grant-...\" messages, i.e. {{msg-mw|Grant-highvolume}}\n* $2 - the codename of this grant", "trackingcategories": "[[Special:TrackingCategories]] page implementing list of Tracking categories [[mw:Special:MyLanguage/Help:Tracking categories|tracking category]].\n{{Identical|Tracking category}}", "trackingcategories-summary": "Description for [[Special:TrackingCategories]] page [[mw:Help:Tracking categories|tracking category]]", "trackingcategories-msg": "Header for the message column of the table on [[Special:TrackingCategories]]. This column lists the mediawiki message that controls the tracking category in question.\n{{Identical|Tracking category}}", -- To view, visit https://gerrit.wikimedia.org/r/323993 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: