Page MenuHomePhabricator

Add an image: edit business rules
Open, HighPublic

Description

When a user publishes a "yes" edit from an "add an image" task, we should insert the image into the article's wikitext using this logic:

  • Image link goes immediately above the article content. This means that it goes below any templates or anything else at the top of the wikitext.
  • Image is linked as a "thumb" with a caption, like: [[File:test.png|thumb|Test caption]]
  • The keywords in the file link ("File" and "thumb") are in the local languages.

An example is the way the image is placed in this article: https://en.wikipedia.org/w/index.php?title=Cord_(unit)&oldid=1040680304

image.png (712×1 px, 157 KB)

Event Timeline

MMiller_WMF renamed this task from Add an image: edit business rules (PLACEHOLDER) to Add an image: edit business rules.Sep 11 2021, 1:28 AM
MMiller_WMF reassigned this task from MMiller_WMF to DMburugu.
MMiller_WMF updated the task description. (Show Details)

@Trizek-WMF @Dyolf77_WMF @Urbanecm_WMF @PPham @Ankan_WMF -- though I think this logic works well in English Wikipedia, I'm not sure how well it translates to other wikis. I don't know whether the keywords "File" and "thumb" will work. Plus, even if they do work, perhaps it is the custom in your wikis to use the local language keywords.

Could you each reply with how placement of images works on your wiki and what you recommend? Will the English keywords work? Should we use the local keywords instead? And in general, does the logic of placing the image link immediately above the content (but below the templates) work well?
Perhaps you'll need to try some things out to see what happens in the articles on your wiki.

@Tgr -- what do you think about all this? Is there a way for us to know/use the local language keywords?

@MMiller_WMF, in bnwiki:

  • Placing an image below the templates but immediately above content is the custom, like enwiki.
  • In Bangla, it is: [[চিত্র:test.png|থাম্ব|Test caption]]. I mean, "File"="চিত্র" and "Thumb"="থাম্ব"। The English keywords work as well, but it is appreciated/expected using the Bangla ones. I shall suggest using local keywords.

We can use localized keywords, yes.

How should whitespace be handled?

beforeafter
{{template}}Text{{template}}[[File:...]]Text
{{template}}
Text
{{template}}
[[File:...]]
Text
{{template}}

Text
{{template}}
[[File:...]]

Text

Does that seem right? Or would it not matter much?

@Trizek-WMF @Dyolf77_WMF @Urbanecm_WMF @PPham @Ankan_WMF -- though I think this logic works well in English Wikipedia, I'm not sure how well it translates to other wikis. I don't know whether the keywords "File" and "thumb" will work. Plus, even if they do work, perhaps it is the custom in your wikis to use the local language keywords.

Could you each reply with how placement of images works on your wiki and what you recommend? Will the English keywords work? Should we use the local keywords instead? And in general, does the logic of placing the image link immediately above the content (but below the templates) work well?

https://w.wiki/43x3 suggests there is a lot of articles with English keywords. I never noticed any opposion in users using English or Czech keywords – in fact, some users even mix them (something like [[File:Test.jpg|thumb|vlevo]]). So, I don't have a preference for the keywords variant -- both will probably be accepted by the community.

Inserting the image above content but below templates should be fine, as far as I know.

Perhaps you'll need to try some things out to see what happens in the articles on your wiki.

On all wikis, "File" and "thumb" will work, but it is better to use the local translations.

Specifically for French, I must confess that I don't use wikitext on article since a while now. I only use VE to edit. I can check on a few articles. However, I guess VE has a rule to insert images, have we checked how it works to reuse it?

If there is no specific rule, can we imagine to have a configuration rule, added to Special:EditGrowthConfig, like TemplateData's Custom formats? It would allow communities to decide which rule should be the best (blank line before the image, blank line after the image...). What @Tgr suggests could be used as the default setting.

On all wikis, "File" and "thumb" will work, but it is better to use the local translations.

That is correct. And I think, ther is a bot translating these words for ar.wiki (I asked Jarallah about it).

Edit
Replied: the bot can handle it, but not doing it right now as community may sees it as a cosmetic task (not important).

If there is no specific rule, can we imagine to have a configuration rule, added to Special:EditGrowthConfig, like TemplateData's Custom formats?

I'd rather not go there, but if we end up with a small set of options, then providing a way to select from those should be simple.

@Trizek-WMF -- I checked what you asked in this comment:

Specifically for French, I must confess that I don't use wikitext on article since a while now. I only use VE to edit. I can check on a few articles. However, I guess VE has a rule to insert images, have we checked how it works to reuse it?

Our rule is the same as VE's rule. It puts the image in like [[File:name.png|thumb|caption goes here]].

@Tgr -- since you say it's no problem to use the local words, I'll add that to the task description. In terms of whitespace, I think it would be fine to just do the same thing to each article, if that's simplest. Maybe a rule that just inserts the file as a new line immediately above the text (I say that because not every article even has templates at the top to anchor a rule to).

Our rule is the same as VE's rule. It puts the image in like [[File:name.png|thumb|caption goes here]].

So this rule, applied to French, inserts [[Fichier:name.png|vignette|Légende]], right? If so, we are good about this part of the business.

@MMiller_WMF I'm sorry for the late reply, it's all because of the Slack's notification...

So in viwiki, we also use File and Thumb with images, so I think there's no problem with that. I guess if File and Thumb can be applied to all wiki, why bother using the local words because that means you will have to have them translated in every wiki. Personally, I don't think there are any problems with using english in viwiki because lots of articles use File and Thumb instead of the local words.

And yeah, putting the image above the content sounds good, I cannot imagine a fitter position for it.

Change 723666 had a related patch set uploaded (by Gergő Tisza; author: Gergő Tisza):

[mediawiki/extensions/GrowthExperiments@master] Add Image: Insert image into document

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

Change 723666 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] Add Image: Insert image into document

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

Moving back to add undo behavior when the user cancels the save dialog.

Change 725521 had a related patch set uploaded (by Gergő Tisza; author: Gergő Tisza):

[mediawiki/extensions/GrowthExperiments@master] Add Image: Remove the image when the save dialog is cancelled

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

Change 725521 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] Add Image: Remove the image when the save dialog is cancelled

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

Checked in wmf.9 (testwiki and arwiki, e.g.

Screen Shot 2021-11-23 at 5.25.02 PM.png (248×2 px, 178 KB)
Screen Shot 2021-11-23 at 5.26.35 PM.png (1×760 px, 603 KB)
Screen Shot 2021-11-23 at 5.25.24 PM.png (1×2 px, 864 KB)

It seems that all specs are in place - moving the task to Testf in Production (for monitoring for feedback).