Merge "Reorder messages that describe operators"

This commit is contained in:
jenkins-bot 2024-03-26 17:18:10 +00:00 committed by Gerrit Code Review
commit 8727b7a7b9
2 changed files with 40 additions and 18 deletions

View file

@ -318,11 +318,11 @@
"abusefilter-edit-builder-op-bool-xor": "XOR (^)",
"abusefilter-edit-builder-group-misc": "Miscellaneous",
"abusefilter-edit-builder-misc-in": "contained in string (in)",
"abusefilter-edit-builder-misc-contains": "Left string contains right string (contains)",
"abusefilter-edit-builder-misc-like": "Matches pattern (like)",
"abusefilter-edit-builder-misc-stringlit": "String literal (\"\")",
"abusefilter-edit-builder-misc-rlike": "Matches regex (rlike)",
"abusefilter-edit-builder-misc-irlike": "Matches regex, case-insensitive (irlike)",
"abusefilter-edit-builder-misc-contains": "Left string contains right string (contains)",
"abusefilter-edit-builder-misc-stringlit": "String literal (\"\")",
"abusefilter-edit-builder-misc-tern": "Ternary operator (X ? Y : Z)",
"abusefilter-edit-builder-misc-cond": "Conditional (if X then Y else Z end)",
"abusefilter-edit-builder-misc-cond-short": "Short conditional (if X then Y end)",
@ -354,17 +354,16 @@
"abusefilter-edit-builder-funcs-set_var": "Set variable (set_var)",
"abusefilter-edit-builder-funcs-sanitize": "Normalize HTML entities into unicode characters (sanitize)",
"abusefilter-edit-builder-group-vars": "Variables",
"abusefilter-edit-builder-vars-accountname": "Account name (on account creation)",
"abusefilter-edit-builder-vars-timestamp": "Unix timestamp of change",
"abusefilter-edit-builder-vars-timestamp-expanded": "Timestamp of the log",
"abusefilter-edit-builder-vars-accountname": "Account name (on account creation)",
"abusefilter-edit-builder-vars-action": "Action",
"abusefilter-edit-builder-vars-addedlines": "Lines added in edit",
"abusefilter-edit-builder-vars-delta": "Size change in edit",
"abusefilter-edit-builder-vars-diff": "Unified diff of changes made by edit",
"abusefilter-edit-builder-vars-newsize": "New page size",
"abusefilter-edit-builder-vars-oldsize": "Old page size",
"abusefilter-edit-builder-vars-old-content-model": "Old content model",
"abusefilter-edit-builder-vars-new-content-model": "New content model",
"abusefilter-edit-builder-vars-old-content-model": "Old content model",
"abusefilter-edit-builder-vars-removedlines": "Lines removed in edit",
"abusefilter-edit-builder-vars-summary": "Edit summary/reason",
"abusefilter-edit-builder-vars-page-id": "Page ID",
@ -390,17 +389,11 @@
"abusefilter-edit-builder-vars-user-rights": "Rights that the user has",
"abusefilter-edit-builder-vars-user-blocked": "Whether the user is blocked",
"abusefilter-edit-builder-vars-user-emailconfirm": "Time email address was confirmed",
"abusefilter-edit-builder-vars-recent-contributors": "Last ten users to contribute to the page",
"abusefilter-edit-builder-vars-first-contributor": "First user to contribute to the page",
"abusefilter-edit-builder-vars-movedfrom-recent-contributors": "Last ten users to contribute to move source page",
"abusefilter-edit-builder-vars-movedfrom-first-contributor": "First user to contribute to move source page",
"abusefilter-edit-builder-vars-movedto-recent-contributors": "Last ten users to contribute to move destination page",
"abusefilter-edit-builder-vars-movedto-first-contributor": "First user to contribute to move destination page",
"abusefilter-edit-builder-vars-all-links": "All external links in the new text",
"abusefilter-edit-builder-vars-added-links": "All external links added in the edit",
"abusefilter-edit-builder-vars-removed-links": "All external links removed in the edit",
"abusefilter-edit-builder-vars-old-wikitext": "Old page wikitext, before the edit",
"abusefilter-edit-builder-vars-new-wikitext": "New page wikitext, after the edit",
"abusefilter-edit-builder-vars-added-links": "All external links added in the edit",
"abusefilter-edit-builder-vars-removed-links": "All external links removed in the edit",
"abusefilter-edit-builder-vars-all-links": "All external links in the new text",
"abusefilter-edit-builder-vars-new-pst": "New page wikitext, pre-save transformed",
"abusefilter-edit-builder-vars-diff-pst": "Unified diff of changes made by edit, pre-save transformed",
"abusefilter-edit-builder-vars-addedlines-pst": "Lines added in edit, pre-save transformed",
@ -410,18 +403,21 @@
"abusefilter-edit-builder-vars-restrictions-move": "Move protection level of the page",
"abusefilter-edit-builder-vars-restrictions-create": "Create protection of the page",
"abusefilter-edit-builder-vars-restrictions-upload": "Upload protection of the file",
"abusefilter-edit-builder-vars-recent-contributors": "Last ten users to contribute to the page",
"abusefilter-edit-builder-vars-first-contributor": "First user to contribute to the page",
"abusefilter-edit-builder-vars-movedfrom-restrictions-edit": "Edit protection level of move source page",
"abusefilter-edit-builder-vars-movedfrom-restrictions-move": "Move protection level of move source page",
"abusefilter-edit-builder-vars-movedfrom-restrictions-create": "Create protection of move source page",
"abusefilter-edit-builder-vars-movedfrom-restrictions-upload": "Upload protection of move source file",
"abusefilter-edit-builder-vars-movedfrom-recent-contributors": "Last ten users to contribute to move source page",
"abusefilter-edit-builder-vars-movedfrom-first-contributor": "First user to contribute to move source page",
"abusefilter-edit-builder-vars-movedto-restrictions-edit": "Edit protection level of move destination page",
"abusefilter-edit-builder-vars-movedto-restrictions-move": "Move protection level of move destination page",
"abusefilter-edit-builder-vars-movedto-restrictions-create": "Create protection of move destination page",
"abusefilter-edit-builder-vars-movedto-restrictions-upload": "Upload protection of move destination file",
"abusefilter-edit-builder-vars-old-text": "Old page text, stripped of any markup (no longer in use)",
"abusefilter-edit-builder-vars-movedto-recent-contributors": "Last ten users to contribute to move destination page",
"abusefilter-edit-builder-vars-movedto-first-contributor": "First user to contribute to move destination page",
"abusefilter-edit-builder-vars-old-links": "Links in the page, before the edit",
"abusefilter-edit-builder-vars-old-html": "Old page wikitext, parsed into HTML (no longer in use)",
"abusefilter-edit-builder-vars-minor-edit": "Whether or not the edit is marked as minor (no longer in use)",
"abusefilter-edit-builder-vars-file-sha1": "SHA1 hash of file contents",
"abusefilter-edit-builder-vars-file-size": "Size of the file in bytes",
"abusefilter-edit-builder-vars-file-mime": "MIME type of the file",
@ -431,6 +427,10 @@
"abusefilter-edit-builder-vars-file-bits-per-channel": "Bits per color channel of the file",
"abusefilter-edit-builder-vars-wiki-name": "Database name of the wiki",
"abusefilter-edit-builder-vars-wiki-language": "Language code of the wiki",
"abusefilter-edit-builder-vars-old-text": "Old page text, stripped of any markup (no longer in use)",
"abusefilter-edit-builder-vars-old-html": "Old page wikitext, parsed into HTML (no longer in use)",
"abusefilter-edit-builder-vars-minor-edit": "Whether or not the edit is marked as minor (no longer in use)",
"abusefilter-edit-builder-vars-timestamp-expanded": "Timestamp of the log",
"abusefilter-filter-log": "Recent filter changes",
"abusefilter-history": "Change history for Abuse Filter #$1",
"abusefilter-history-foruser": "Changes by $1",

View file

@ -10,6 +10,16 @@ use MediaWiki\Extension\AbuseFilter\Hooks\AbuseFilterHookRunner;
class KeywordsManager {
public const SERVICE_NAME = 'AbuseFilterKeywordsManager';
/**
* Operators and functions that can be used in AbuseFilter code.
* They are shown in the dropdown in the filter editor.
* Keys of translatable messages with their descriptions are
* based on keys of this array.
* When editing this list or the messages, keep the order
* consistent in both lists.
*
* @var array
*/
private const BUILDER_VALUES = [
'op-arithmetic' => [
// Generates abusefilter-edit-builder-op-arithmetic-addition
@ -277,10 +287,22 @@ class KeywordsManager {
],
];
/** @var array Old vars which aren't in use anymore */
/**
* Old vars which aren't in use anymore.
* The translatable messages that are based
* on them are not shown in the filter editor,
* but may still be shown in the log descriptions of
* filter actions that were taken by filters
* that used them.
*
* @var array
*/
private const DISABLED_VARS = [
// Generates abusefilter-edit-builder-vars-old-text
'old_text' => 'old-text',
// Generates abusefilter-edit-builder-vars-old-html
'old_html' => 'old-html',
// Generates abusefilter-edit-builder-vars-minor-edit
'minor_edit' => 'minor-edit'
];