Skip to content

Commit

Permalink
Remove newsletter preference and related code
Browse files Browse the repository at this point in the history
Bug: T134633
Depends-On: Idb9cb611c60b69836d1ceeece294927a6ff10f01
Change-Id: I6694fc6133ed119488579e19d71bdcfe542b31fc
  • Loading branch information
Nikerabbit authored and jenkins-bot committed Jul 7, 2020
1 parent b957aca commit 1c43244
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 41 deletions.
10 changes: 1 addition & 9 deletions extension.json
Original file line number Diff line number Diff line change
Expand Up @@ -289,10 +289,7 @@
"SpecialTranslate::tabify",
"SpecialManageGroups::tabify"
],
"GetPreferences": [
"TranslatePreferences::onGetPreferences",
"TranslatePreferences::translationAssistLanguages"
],
"GetPreferences": "TranslatePreferences::translationAssistLanguages",
"ChangesListSpecialPageQuery": "TranslateRcFilter::translationFilter",
"SpecialRecentChangesPanel": "TranslateRcFilter::translationFilterForm",
"ChangesListSpecialPageStructuredFilters": "TranslateRcFilter::onChangesListSpecialPageStructuredFilters",
Expand Down Expand Up @@ -886,11 +883,6 @@
"description": "Name of the bot which will invalidate translations and do maintenance for page translation feature. Also used for importing messages from external sources.",
"public": true
},
"TranslateNewsletterPreference": {
"value": false,
"description": "Add a preference 'Do not send me email newsletters' in the email preferences.",
"public": true
},
"TranslateLanguageFallbacks": {
"value": [],
"description": "Default values for list of languages to show translators as an aid when translating. Each user can override this setting in their preferences.\n\nExample: LanguageFallbacks['fi'] = 'sv' or LanguageFallbacks['sv'] = [ 'da', 'no', 'nn' ].",
Expand Down
1 change: 0 additions & 1 deletion i18n/core/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@
"translate-checks-newline-extra-start": "There {{PLURAL:$1|is|are}} $1 extra newline {{PLURAL:$1|character|characters}} at the beginning of the translation.",
"translate-checks-newline-extra-end": "There {{PLURAL:$1|is|are}} $1 extra newline {{PLURAL:$1|character|characters}} at the end of the translation.",
"translate-checks-value-not-present": "The translation must be equal to {{PLURAL:$1|1=|one of the following values:}} $1.",
"translate-pref-nonewsletter": "Do not send me email newsletters",
"translate-pref-editassistlang": "Assistant languages:",
"prefs-translate": "Translation options",
"translate-pref-editassistlang-help": "Comma separated list of language codes.\nTranslation of a message in these languages are shown when you are translating.\nThe default list of languages depends on your language.",
Expand Down
1 change: 0 additions & 1 deletion i18n/core/qqq.json
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@
"translate-checks-newline-extra-start": "Notice message shown when there are extra newline characters are at the start of a translation. Parameters:\n* $1 - number of extra characters.",
"translate-checks-newline-extra-end": "Notice message shown when there are extra newline characters are at the end of a translation. Parameters:\n* $1 - number of extra characters.",
"translate-checks-value-not-present": "Notice message shown when the translation is not present in the set of permitted values. Parameters:\n* $1 - set of permitted values.",
"translate-pref-nonewsletter": "Option in [[Special:Preferences]], 'Misc' tab.",
"translate-pref-editassistlang": "Used in [[Special:Preferences]] under the {{msg-mw|prefs-editing}} tab.\n{{Identical|Assistant language}}",
"prefs-translate": "Caption of a section at [[Special:Preferences#mw-prefsection-editing|Special:Preferences]] in the tab \"{{int:prefs-editing}}\"",
"translate-pref-editassistlang-help": "Used in [[Special:Preferences]], tab Editing.",
Expand Down
30 changes: 0 additions & 30 deletions utils/TranslatePreferences.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,36 +13,6 @@
* Class to add Translate specific preference settings.
*/
class TranslatePreferences {
/**
* Add 'translate-pref-nonewsletter' preference.
* This is most probably specific to translatewiki.net. Can be enabled
* with $wgTranslateNewsletterPreference.
* @param User $user
* @param array &$preferences
* @return bool
*/
public static function onGetPreferences( User $user, array &$preferences ) {
global $wgTranslateNewsletterPreference;

if ( !$wgTranslateNewsletterPreference ) {
return true;
}

global $wgEnableEmail;

// Only show if email is enabled and user has a confirmed email address.
if ( $wgEnableEmail && $user->isEmailConfirmed() ) {
// 'translate-pref-nonewsletter' is used as opt-out for
// users with a confirmed email address
$preferences['translate-nonewsletter'] = [
'type' => 'toggle',
'section' => 'personal/email',
'label-message' => 'translate-pref-nonewsletter'
];

}
}

/**
* Add 'translate-editlangs' preference.
* These are the languages also shown when translating.
Expand Down

0 comments on commit 1c43244

Please sign in to comment.