Merge "Remove repetition in "Discussion pages" preferences"

This commit is contained in:
jenkins-bot 2021-08-19 14:46:57 +00:00 committed by Gerrit Code Review
commit b7978be7ed
3 changed files with 13 additions and 3 deletions

View file

@ -37,14 +37,15 @@
"discussiontools-preference-discussion-link": "https://www.mediawiki.org/wiki/Talk:Talk_pages_project",
"discussiontools-preference-info-link": "https://www.mediawiki.org/wiki/Special:MyLanguage/Talk_pages_project/Feature_summary",
"discussiontools-preference-label": "Discussion tools",
"discussiontools-preference-summary": "You can learn more about these features by reading the [https://www.mediawiki.org/wiki/Special:MyLanguage/Talk_pages_project/Feature_summary feature summary].",
"discussiontools-preference-newtopictool": "Enable quick topic adding",
"discussiontools-preference-newtopictool-help": "This will show you an inline form for adding new topics. You can learn more about this feature by reading the [https://www.mediawiki.org/wiki/Special:MyLanguage/Talk_pages_project/Feature_summary feature summary].",
"discussiontools-preference-newtopictool-help": "This will show you an inline form for adding new topics.",
"discussiontools-preference-replytool": "Enable quick replying",
"discussiontools-preference-replytool-help": "This will show you a link to reply to talk page comments in one click. You can learn more about this feature by reading the [https://www.mediawiki.org/wiki/Special:MyLanguage/Talk_pages_project/Feature_summary feature summary].",
"discussiontools-preference-replytool-help": "This will show you a link to reply to talk page comments in one click.",
"discussiontools-preference-sourcemodetoolbar": "Enable editing tools in source mode",
"discussiontools-preference-sourcemodetoolbar-help": "This will add a toolbar to the quick replying and quick topic adding features source modes that includes shortcuts for pinging and adding links.",
"discussiontools-preference-topicsubscription": "Enable topic subscription",
"discussiontools-preference-topicsubscription-help": "This will allow you to subscribe to receive notifications about comments on individual topics. You can learn more about this feature by reading the [https://www.mediawiki.org/wiki/Special:MyLanguage/Talk_pages_project/Feature_summary feature summary].",
"discussiontools-preference-topicsubscription-help": "This will allow you to subscribe to receive notifications about comments on individual topics.",
"discussiontools-replylink": "reply",
"discussiontools-replywidget-abandon": "Are you sure you want to discard the comment you are writing?",
"discussiontools-replywidget-abandon-discard": "Discard comment",

View file

@ -46,6 +46,7 @@
"discussiontools-preference-discussion-link": "{{optional|Used on [[Special:Preferences]] as a link to a page where users can discuss this Beta Feature. Defaults to a page on MediaWiki.org.}}",
"discussiontools-preference-info-link": "{{optional|Used on [[Special:Preferences]] as a link to a page where users can learn about this Beta Feature. Defaults to a page on MediaWiki.org.}}",
"discussiontools-preference-label": "Used in [[Special:Preferences]].\n\nUsed as label for checkbox to enable discussion tools as Beta Feature.\n\nThe description for this checkbox is: {{msg-mw|discussiontools-preference-description}}",
"discussiontools-preference-summary": "Used in [[Special:Preferences]] in the section titled {{msg-mw|prefs-discussion}}, at the top as a summary for the whole section.",
"discussiontools-preference-newtopictool": "Used in [[Special:Preferences]] in the section titled {{msg-mw|prefs-discussion}}, in the same list with:\n* {{msg-mw|Discussiontools-preference-replytool}}.\n\nUsed as label for checkbox to enable the new topic tool.\n\nThe help text for this checkbox is: {{msg-mw|discussiontools-preference-newtopictool-help}}",
"discussiontools-preference-newtopictool-help": "Used in [[Special:Preferences]].\n\nUsed as help text for the checkbox {{msg-mw|discussiontools-preference-newtopictool}}",
"discussiontools-preference-replytool": "Used in [[Special:Preferences]] in the section titled {{msg-mw|prefs-discussion}}, in the same list with:\n* {{msg-mw|Discussiontools-preference-newtopictool}}.\n\nUsed as label for checkbox to enable the reply tool.\n\nThe help text for this checkbox is: {{msg-mw|discussiontools-preference-replytool-help}}",

View file

@ -24,6 +24,14 @@ class PreferenceHooks implements
* @param array &$preferences
*/
public function onGetPreferences( $user, &$preferences ) {
if ( HookUtils::isFeatureAvailableToUser( $user ) ) {
$preferences['discussiontools-summary'] = [
'type' => 'info',
'default' => wfMessage( 'discussiontools-preference-summary' )->parse(),
'raw' => true,
'section' => 'editing/discussion',
];
}
foreach ( HookUtils::FEATURES as $feature ) {
if ( HookUtils::isFeatureAvailableToUser( $user, $feature ) ) {
$preferences["discussiontools-$feature"] = [