Page MenuHomePhabricator

{{PLURAL}} and {{#FORMAL}} don't work in MediaWiki:Abusefilter-edit-protected-variable-not-protected
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue:

  • As a user with the necessary permissions, create a new abuse filter via Special:AbuseFilter/new using a single protected variable and click "save"

What happens?:

Screenshot 2025-07-02 at 19.14.11.png (860×1 px, 162 KB)

  • The same issue occurs in German (plural "geschützte Variablen"). Additionally {{#FORMAL}} doesn't work at all.

Screenshot 2025-07-02 at 18.45.19.png (468×1 px, 120 KB)

What should have happened instead?:

  • Given that the message uses {{PLURAL:$1|protected variable|protected variables}}, it should read "protected variable" if there's only one single variable
  • {{#FORMAL}} should work and only show the non-formal version (or the formal version if I change my language settings).

Other information:

  • @Raymond and I agreed that removing {{#FORMAL}} from the de-translation is ok, but that leaves the issue with {{PLURAL}} (and ideally you can fix both issues at once).

Event Timeline

{{PLURAL:$1|protected variable|protected variables}}

$1 here is the list of protected variables, not their number, so that explains why PLURAL doesn't work. I don't know about the issue with FORMAL.

In T398476#10969105, @Daimona hat geschrieben:

{{PLURAL:$1|protected variable|protected variables}}

$1 here is the list of protected variables, not their number, so that explains why PLURAL doesn't work. I don't know about the issue with FORMAL.

But I think PLURAL is needed because otherwise in case of 1 protected variable only: "...protected variables: something" is wrong, at least for German

In T398476#10969105, @Daimona hat geschrieben:

{{PLURAL:$1|protected variable|protected variables}}

$1 here is the list of protected variables, not their number, so that explains why PLURAL doesn't work. I don't know about the issue with FORMAL.

But I think PLURAL is needed because otherwise in case of 1 protected variable only: "...protected variables: something" is wrong, at least for German

Yes, sorry, I meant that the code is only passing a single parameter ($1) which is a comma-list of protected variables. That parameter is passed to {{PLURAL}}, but because it isn't a number, we can't apply pluralization rules to it. I'll quickly make a patch for this.

Change #1165963 had a related patch set uploaded (by Daimona Eaytoy; author: Daimona Eaytoy):

[mediawiki/extensions/AbuseFilter@master] i18n: Pass numeric parameter to PLURAL in protected variables message

https://gerrit.wikimedia.org/r/1165963

Change #1165963 merged by jenkins-bot:

[mediawiki/extensions/AbuseFilter@master] i18n: Pass numeric parameter to PLURAL in protected variables message

https://gerrit.wikimedia.org/r/1165963

Dreamy_Jazz assigned this task to Daimona.
Dreamy_Jazz updated the task description. (Show Details)
Dreamy_Jazz subscribed.

AFAICS the issue with PLURAL is fixed and the issue with the FORMAL is no longer needed to be fixed -> closing this.

[…] the issue with the FORMAL is no longer needed to be fixed -> closing this.

The issue for this message was that the syntax was wrong – the message used {{#FORMAL|Dein Filter|Ihr Filter}} where it should have used {{#FORMAL:Dein Filter|Ihr Filter}} with a colon instead of a pipe.