Page MenuHomePhabricator

Editing a gallery with pre-native code converts any alias name for "File:" namespace to canonical localized one
Closed, DeclinedPublic1 Estimated Story Points

Description

In this diff in the visual editor the word Immagine is getting automatically replaced by File. I was just adding a title to the gallery. I personally don't care if that happens, but it doesn't really seem necessary.
I believe that elsewhere people were having the opposite expectation, so it is likely that this behavior is not desired.

Event Timeline

As fas as I can tell, this is because of T110910: Implement <gallery> extension natively inside Parsoid being deployed. T151367 exists to investigate how bad the normalizations are.

ssastry triaged this task as Medium priority.

this is because of T110910: Implement <gallery> extension natively inside Parsoid being deployed

If it is, then I messed up. That should have only affected rendering, extsrc and, hence, serialization should be the same as before.

As fas as I can tell, this is because of T110910: Implement <gallery> extension natively inside Parsoid being deployed. T151367 exists to investigate how bad the normalizations are.

My comment there is primarily circumstantial evidence. :) We don't expect VE to be leveraging HTML editing support yet (which is when we would expect these normalizations to happen), so part of the investigation is to figure out if VE is somehow doing something unexpected here.

> echo -e "<gallery>\nImmagine:Sandbox Not.svg\n</gallery>" | node bin/parse --wt2wt --prefix itwiki
<gallery>
Immagine:Sandbox Not.svg
</gallery>

@Esanders, @Krenair: can you look at the VE end of this? Is VE now relying on HTML-based serialization for galleries?

It looks like VE is returning,

<ul typeof="mw:Extension/gallery" data-mw="{&quot;name&quot;:&quot;gallery&quot;,&quot;attrs&quot;:{&quot;mode&quot;:&quot;packed&quot;},&quot;body&quot;:{&quot;extsrc&quot;:&quot;\nFile:Sandbox Not.svg\nFile:Sanxbox.JPG\nFile:Sandbox not.png\nFile:Sandbox green icon.png\n&quot;}}" class="gallery mw-gallery-traditional" about="#mwt6" id="mwAQ"></ul>

when I edit the 84742055 version of that page, changing the mode to packed.

I think this predates T110910 but, yeah, T151367 will certainly help in determining what to support.

Arlolra subscribed.
Jdforrester-WMF renamed this task from Automatic conversion of localized name for "File" to English one to [Regression] Editing a gallery converts localized name for "File:" to English one.Dec 12 2016, 7:26 PM
Jdforrester-WMF raised the priority of this task from Medium to High.
Jdforrester-WMF set the point value for this task to 1.
Jdforrester-WMF moved this task from To Triage to TR0: Interrupt on the VisualEditor board.
Jdforrester-WMF added a subscriber: Tchanders.

Appears to be working fine on fr.wiki:

pasted_file (298×868 px, 37 KB)

Maybe the is a config issue with it.wiki?

@ssastry The version that relies on HTML-based serialization hasn't been deployed yet, but there have been some recent changes around the prefixes.

It's probably from the normalization of the file prefix in T150638 - one side effect is that if a gallery has non-local prefixes on filenames (e.g. "File:" instead of "Fichier:" in French), the gallery dialog will alter them to the local prefix. Is the local prefix on Italian wikipedia set to "File:"?

https://it.wikipedia.org/w/api.php?action=query&meta=siteinfo&siprop=namespaces

"6": {
    "id": 6,
    "case": "first-letter",
    "canonical": "File",
    "*": "File"
},

https://fr.wikipedia.org/w/api.php?action=query&meta=siteinfo&siprop=namespaces

"6": {
    "id": 6,
    "case": "first-letter",
    "canonical": "File",
    "*": "Fichier"
},

Yup, Italian (for whatever reason) has "File" and "Discussioni_file" as the namespace names, with "Immagine" and "Discussioni_immagine" as aliases. Close as Invalid?

From a random sample of about 20 images on it.wiki I only found one use of Immagine. File seems to be the standard for images. Galleries are harder to find but I don't think we should be encouraging inconsistency if both images and URLs are using File.

Maybe I failed to make my point here? I don't care about whether Immagine becomes File or viceversa, I want to know why this is happening and if we can avoid it, given that people have different expectations on whether this change should or should not happen.

It seems that "file" is genuinely considered an Italian word by the few dictionaries I checked (although obviously "imported" from English).

https://en.wiktionary.org/wiki/file#Italian
http://www.wordreference.com/iten/file
https://www.collinsdictionary.com/dictionary/italian-english/file

"Immagine" is a translation of the old name of the namespace, "Image" (it was renamed to "File" in MW 1.14 after people realized we'll want to upload more than images). Either "File" was never translated, or whoever did the translation thought that "File" is sufficiently Italian to leave it. "File" is currently the canonical name for the "File" namespace in Italian in MediaWiki (see /languages/messages/MessagesIt.php).

"File" is also translated to "File" in the names of some special pages and parser functions, so this is probably deliberate:

	'FileDuplicateSearch'       => [ 'CercaFileDuplicati' ],
	'Listfiles'                 => [ 'File', 'Immagini' ],
	'ListDuplicatedFiles'       => [ 'ElencoFileDuplicati' ],
	'Wantedfiles'               => [ 'FileRichiesti' ],
	'numberoffiles'             => [ '1', 'NUMEROFILE', 'NUMBEROFFILES' ],
	'pagesincategory_files'     => [ '0', 'file', 'files' ],

I appreciate your insight, although it does not answer my question.

This is happening because:

  1. "File" is the canonical name for the file namespace in Italian. This is deliberate, but perhaps it's not the best translation; I do not know Italian.
  2. Editing a gallery in VisualEditor will normalize all entries to use the canonical file namespace name. This is probably a bug in VisualEditor or Parsoid.

We could avoid this for edited galleries by fixing the bug, but creating new galleries (or inserting new images into existing ones) will probably still use the canonical name. The only way to avoid that would be to change the name of the namespace (easy technically, less so socially).

matmarex renamed this task from [Regression] Editing a gallery converts localized name for "File:" to English one to [Regression] Editing a gallery converts any alias name for "File:" namespace to canonical localized one.Dec 13 2016, 11:29 AM
matmarex reopened this task as Open.
matmarex lowered the priority of this task from High to Medium.

(There's clearly a bug here. This might be still Declined, or very low priority, but it's definitely not Invalid. Fixed task name to correctly describe the problem.)

Jdforrester-WMF renamed this task from [Regression] Editing a gallery converts any alias name for "File:" namespace to canonical localized one to Editing a gallery with pre-native code converts any alias name for "File:" namespace to canonical localized one.Dec 13 2016, 5:17 PM
Jdforrester-WMF closed this task as Declined.
Jdforrester-WMF removed a project: Regression.