Page MenuHomePhabricator

Properly use language templates in cross-wiki upload
Closed, ResolvedPublic

Description

Symptom: Over the last time several files uploaded by the cross-wiki upload appear in https://commons.wikimedia.org/wiki/Category:Language_templates_with_no_text_displayed, e. g. https://commons.wikimedia.org/wiki/File:Kmeans2.png.

Reason: This is because the description contains {{en|...}} instead of the more safe {{en|1=...}}. The latter one is more safe when the description contains special characters such as =.

Solution: Please modify ForeignStructuredUpload.prototype.getDescriptions accordingly.

Event Timeline

Aschroet raised the priority of this task from to Needs Triage.
Aschroet updated the task description. (Show Details)
Aschroet subscribed.
Restricted Application added subscribers: StudiesWorld, Steinsplitter, Aklapper. · View Herald Transcript

Change 255559 had a related patch set uploaded (by Bartosz Dziewoński):
mediawiki.ForeignStructuredUpload: Behave correctly when '=' appears in a description

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

Change 255559 merged by jenkins-bot:
mediawiki.ForeignStructuredUpload: Behave correctly when '=' appears in a description

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

Change 256028 had a related patch set uploaded (by Jforrester):
mediawiki.ForeignStructuredUpload: Behave correctly when '=' appears in a description

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

@Jforrester, i do not understand why we need to introduce such a complexity by this patch. Explicitly addressing the first parameter by "1=" is always the better choice. All tools such as Upload Wizard etc. do it. Thus, Bartosz' solution is more clean and sufficient.

@Jforrester, i do not understand why we need to introduce such a complexity by this patch. Explicitly addressing the first parameter by "1=" is always the better choice. All tools such as Upload Wizard etc. do it. Thus, Bartosz' solution is more clean and sufficient.

Writing bad wikitext because other tools write bad wikitext is a poor excuse.

Change 256028 merged by jenkins-bot:
mediawiki.ForeignStructuredUpload: Behave correctly when '=' appears in a description

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

Fixed and deployed.

Change 257172 had a related patch set uploaded (by Steinsplitter):

1= should be always used. Following standard on commons.

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

Change 257174 had a related patch set uploaded (by Zhuyifei1999):

1= should be always used. Following standard on commons.

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

Change 257172 abandoned by TTO:

1= should be always used. Following standard on commons.

Reason:
Superseded by Ied787ecb91aaae3f643c9d013b8982ddabea8142

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

Change 257174 merged by jenkins-bot:
mediawiki.ForeignStructuredUpload: Always use '|1=' for description templates

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

1= should be used always.

Can you please explain why you think that's better for users? It's 'broken' (working but stupid) wikitext. Just because UploadWizard fails to use the right syntax doesn't mean it's "policy".

1= should be used always.

Can you please explain why you think that's better for users? It's 'broken' (working but stupid) wikitext. Just because UploadWizard fails to use the right syntax doesn't mean it's "policy".

Please elaborate why it is "broken" wkitext.
It is used by multiple tools. We should try to use always the same sintax. If you believe the current use of |1= is "broken" then i invite you to star a proposal at the village pump for proposals on commons

Creating a policy for such a case would be over bureaucratic, commons sense should be used :-).


Please elaborate why you reverted the patch in https://gerrit.wikimedia.org/r/#/c/257350/ without +1 by the community.

Change 257350 had a related patch set uploaded (by Jforrester):
Revert "mediawiki.ForeignStructuredUpload: Always use '|1=' for description templates"

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

1= should be used always.

Can you please explain why you think that's better for users? It's 'broken' (working but stupid) wikitext. Just because UploadWizard fails to use the right syntax doesn't mean it's "policy".

Please elaborate why it is "broken" wkitext.

As editors, we repeatedly have to explain to users the complex ways in how templates work. Adding extra uses adds to this complexity and makes it harder for people to learn. In general we have a policy that we simplify things for users, so things work as they would expect and are only different when they need to be different. It's the same for interfaces, for wording, for iconography, and it should also be the same for wikitext.

It is used by multiple tools.

OK. Which ones? Can you point me to any design documents? Are they using it because it's a good idea or just because you want them to do so? :-)

We should try to use always the same sintax.

I agree. But I think you're thinking of more limited cases for "the same". I'm thinking of citations, infoboxen, conversion templates and the millions of other uses of this syntax.

If you believe the current use of |1= is "broken" then i invite you to star a proposal at the village pump for proposals on commons

I think that's really bureaucratic. Hundreds of changes go out each week. Why do you think this needs a discussion first? Is it that surprising?

Creating a policy for such a case would be over bureaucratic, commons sense should be used :-).

I agree – but I think common sense is to use the normal form.

Please elaborate why you reverted the patch in https://gerrit.wikimedia.org/r/#/c/257350/ without +1 by the community.

I haven't reverted anything yet, I've proposed a revert of your requested revert of MatmaRex's patch which I had asked him to make.

! In T119691 @Jdforrester-WMF wrote:

Thanks for the fats reply :-)

OK. Which ones? Can you point me to any design documents? Are they using it because it's a good idea or just because you want them to do so? :-)

https://commons.wikimedia.org/wiki/Template:En#Usage is the relevant documentation.

I haven't reverted anything yet, I've proposed a revert of your requested revert of MatmaRex's patch which I had asked him to make.

Ok. Sorry for the misunderstanding.

Please elaborate why it is "broken" wkitext.

As editors, we repeatedly have to explain to users the complex ways in how templates work. Adding extra uses adds to this complexity and makes it harder for people to learn. In general we have a policy that we simplify things for users, so things work as they would expect and are only different when they need to be different. It's the same for interfaces, for wording, for iconography, and it should also be the same for wikitext.

The problem here is that it is currently impossible to use wikitext logically on language templates, when a user have to add a url with params (or other sources of equals sign) to a language template. While "|1=" does not look beautiful, it eliminate the possible confusion when a user find the language template completely gone after adding stuffs.

@Jdforrester-WMF I guess the question is whether we would rather confuse users by adding a strange 1= to their edits even when it is not strictly necessary or by exposing them to strange breakage when they try to edit the description later and add an =. The first seems less painful to me.

The problem here is that it is currently impossible to use wikitext logically on language templates, when a user have to add a url with params (or other sources of equals sign) to a language template. While "|1=" does not look beautiful, it eliminate the possible confusion when a user find the language template completely gone after adding stuffs.

If the user is not competent to edit wikitext and know to put 1=, they should use the visual editor.

What is the status of the ticket in terms of code? Is one of the solutions already in production?

Yes. The original fix (using '|' or '|1=' as needed) was deployed on December 1, as noted above; Steinsplitter's change to always use '|1=' was deployed with MediaWiki 1.27.0-wmf.8 last week. James's revert of that to the original fix is in review/discussion. Either way, the original issue is fixed.

Change 257350 abandoned by Krinkle:
[mediawiki/core@master] Revert "mediawiki.ForeignStructuredUpload: Always use '|1=' for description templates"

Reason:
Assuming not.

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