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.
Description
Related Objects
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.
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.
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>
It looks like VE is returning,
<ul typeof="mw:Extension/gallery" data-mw="{"name":"gallery","attrs":{"mode":"packed"},"body":{"extsrc":"\nFile:Sandbox Not.svg\nFile:Sanxbox.JPG\nFile:Sandbox not.png\nFile:Sandbox green icon.png\n"}}" 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.
@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' ],
This is happening because:
- "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.
- 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).
(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.)