Page MenuHomePhabricator

[Spike 4 hour] [BUG] MediaViewer ignores thumbnail options when using API provider for thumbnails
Closed, ResolvedPublicSpike

Description

Steps to reproduce:

  1. Got to https://de.wikipedia.beta.wmflabs.org/wiki/SVG-Test
  2. The SVG uses no lang parameter, so since T205040: Show SVGs in page language if available it is shown in the content language, here in German.
  3. Click the image, wait until MMV has finished loading.

Expected: The image in MMV should be in German, too.
Actual: It's in English.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Niharika renamed this task from MMV should show SVGs in language of the page, not English to [BUG] MMV should show SVGs in language of the page, not English.Nov 2 2018, 7:51 PM
Niharika moved this task from New & TBD Tickets to Needs Discussion on the Community-Tech board.
Tgr renamed this task from [BUG] MMV should show SVGs in language of the page, not English to [BUG] MediaViewer ignores thumbnail options when using API provider for thumbnails.Nov 2 2018, 8:30 PM
Tgr reopened this task as Open.

Actually a different bug from T60663: media viewer doesn't preserve thumbnail options like svg language (which seems to have been fixed somewhere along the line, at least for SVGs) - the URL guessing provider (mmv.provider.GuessedThumbnailInfo.js) preserves the language but the API-based provider does not. So language detection would work in Wikimedia production but not on most other wikis.

Niharika renamed this task from [BUG] MediaViewer ignores thumbnail options when using API provider for thumbnails to [Spike 4 hour] [BUG] MediaViewer ignores thumbnail options when using API provider for thumbnails.Nov 21 2018, 12:50 AM
Niharika moved this task from Needs Discussion to Up Next (June 3-21) on the Community-Tech board.
Niharika edited projects, added: SVG Translate Tool; removed: Community-Tech.
Restricted Application changed the subtype of this task from "Task" to "Spike". · View Herald Transcript
Jdlrobson lowered the priority of this task from Medium to Low.May 14 2024, 4:00 PM

@simon04 you essentially have to do a two pass. You need to get the known translations from metadata from it's translations sub attribute

https://commons.wikimedia.org/wiki/Special:ApiSandbox#action=query&format=json&smaxage=86400&maxage=86400&prop=imageinfo&titles=File%3AMultilingual_SVG_example.svg&formatversion=2&iiprop=url%7Cmetadata&iiurlwidth=1920

And then hand specify the thumb parameter prefix, including the width you are targeting and match it to your iiurlwidth

https://commons.wikimedia.org/wiki/Special:ApiSandbox#action=query&format=json&smaxage=86400&maxage=86400&prop=imageinfo&titles=File%3AMultilingual_SVG_example.svg&formatversion=2&iiprop=url&iiurlwidth=1920&iiurlparam=langde-1920px

Change #1036570 had a related patch set uploaded (by Simon04; author: Simon04):

[mediawiki/extensions/MultimediaViewer@master] ThumbnailInfo: support multi lingual SVG

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

TheDJ assigned this task to simon04.

Change #1036570 merged by jenkins-bot:

[mediawiki/extensions/MultimediaViewer@master] ThumbnailInfo: support multi lingual SVG

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