Page MenuHomePhabricator

PLURAL not supported in UploadWizard upload phase
Open, LowPublic

Description

The message file-exists-duplicate, when used on the UploadWizard, is shown unparsed, like:

Questo file è un duplicato {{PLURAL:$1|del seguente|dei seguenti}} file:

The translation is correct: https://translatewiki.net/wiki/MediaWiki:File-exists-duplicate/it

Event Timeline

Nemo_bis created this task.Feb 5 2020, 8:59 PM
Restricted Application added subscribers: Liuxinyu970226, Aklapper. · View Herald TranscriptFeb 5 2020, 8:59 PM
Aklapper moved this task from Untriaged to Plural on the I18n board.

Yes, we usually file a separate report for each incorrectly used message. It's usually something silly like forgetting to load jqueryMsg https://www.mediawiki.org/wiki/Manual:Messages_API#Notes_about_gender,_grammar,_plural , although sometimes it's more complicated.

Yes, we usually file a separate report for each incorrectly used message.

I just said 'related'. I didn't imply anything else.

Same thing in English:

This file is a duplicate of the following {{PLURAL:$1|file|files}}:

This is odd, because deletion of https://commons.wikimedia.beta.wmflabs.org/wiki/MediaWiki:File-deleted-duplicate did resolve the problem for that message. The only obvious difference I see is that that message only includes a link and the message in this phab only includes a template. See also T246879.

As I noted in the duplicate bug, in the console, the following warning is thrown, which might be relevant:

VM96:90 mediawiki.jqueryMsg: file-exists-duplicate: Cannot read property 'hasAlreadyBeenUsedAsAReplacement' of undefined
Sdkb awarded a token.Mar 16 2020, 4:56 AM
Sdkb added a subscriber: Sdkb.
MarkTraceur triaged this task as Low priority.Jul 6 2020, 4:29 PM
MarkTraceur added a subscriber: MarkTraceur.

Huh. So I'm slowly working my way backwards in time through the untriaged bugs, and this (being the third similar issue reported that I've seen so far) seems like it may just be a general bug across our upload error/warning handlers, or possibly in the message system. The code looks good on first glance, and I haven't found any big "DEPRECATION/BREAKING CHANGE" emails about jqueryMsg or mw.Message#parse yet, so I assume these things are still fine, and there's just a problem with the way we're using them in UploadWizard.

Anyway, I'm marking this as low for now and noting that T246879 seems pretty similar.

Also: I have tested on beta and in production with obviously-duplicate files, and have not been able to reproduce, so we may need additional details about future reports.

AlexisJazz added subscribers: Esanders, Krinkle.EditedJul 7 2020, 11:09 PM

@MarkTraceur I can't reproduce it anymore either. @Krinkle and @Esanders have recently made a change to mediawiki.jqueryMsg.js, maybe one of those fixed it.

..or the parameters that were passed were bad and have been fixed, that would probably have the same result.

@MarkTraceur sorry, correction, the bug is still kinda present but not in the same form. When uploading a file for which one (1) duplicate file exists, the message that is shown is:

This file is a duplicate of the following files:
    File:A session with a psychotherapist (751707089).jpg

It uses plural despite there being only one file. The argument ($1) is actually always empty.