Page MenuHomePhabricator

Finnish wiki says "invalid wikicode" for lang-switched SVG, for no obvious reason
Closed, InvalidPublic

Description

I added "|lang=fi" to an SVG figure inclusion on the Finnish Wikipedia to select the Finnish figure labels:

https://fi.wikipedia.org/w/index.php?title=Paraabeli&diff=16870921&oldid=16113449

The resulting figure inclusion becomes

[[Tiedosto:Conic Sections.svg|lang=fi|right|thumb|240px|Paraabeli on eräs [[kartioleikkaus|kartioleikkauksista]].]]

Which should be equivalent to the English WP syntax

[[File:Conic Sections.svg|lang=fi|right|thumb|240px|...]]

The image on the fi.Wikipedia displays correctly the Finnish labels. The parabola on the conic section is labeled "Paraabeli", which is the title of the Finnish article.

Looking more closely at the heading of the diff shows:

Versio 2. marraskuuta 2017 kello 18.18 (muokkaa) (kumoa)
Glrx (keskustelu | muokkaukset)
(lang=fi)
(Merkkaus:  virheellinen wikikoodi )
Uudempi muutos →

Where the important part is "(Merkkaus: virheellinen wikikoodi)

which translates to "(Markup: invalid wikicode)"

That warning causes other editors to come along and revert the change.

The wikicode works, so I don't see why it should be signaled as invalid.

Event Timeline

Aklapper renamed this task from Finnish wiki says bad wikicode for lang-switched SVG to Finnish wiki says "invalid wikicode" for lang-switched SVG, for no obvious reason.Nov 6 2017, 8:36 PM
Aklapper added a subscriber: Framawiki.

@Framawiki: Wikimedia-SVG-rendering seems to better fit here? :)

This seems not an SVG code problem (alone?), rather a MediaWiki parser problem. It would be new to me if the Wiki parser checks SVG code.

There is nothing wrong with the SVG rendering. The wiki markup produces correct HTML with an img element that displays a Finnish PNG version of the i18n SVG. The image looks fine. The problem is that the fi.WP flagged the addition of the "|lang=fi" parameter as bad wiki markup even though the markup should be correct.

I do not believe that is happening on either en.WP or de.WP. I would have noticed the error on en.WP. I'd expect de.WP/Graphikwerkstatt to notice the problem. My guess is fi.WP does something different.

I went to fi.WP to test if changing "lang=fi" to "lang=de" would produce the error message. It did not. https://fi.wikipedia.org/w/index.php?title=Paraabeli&diff=17085761&oldid=16879725

I changed "lang=de" back to "lang=fi", and that did not produce an error message. https://fi.wikipedia.org/w/index.php?title=Paraabeli&diff=17085766&oldid=17085761

I delete the "|lang=fi" argument completely, AND THAT PRODUCES THE ERROR MESSAGE. https://fi.wikipedia.org/w/index.php?title=Paraabeli&diff=17085769&oldid=17085766 . I do not understand that at all; there's no lang parameter, so the markup is completely conventional.

I reinsert the "|lang=fi" argument, AND THAT PRODUCES THE ERROR MESSAGE. https://fi.wikipedia.org/w/index.php?title=Paraabeli&diff=17085773&oldid=17085769 . That reproduces the original error.

I check the SVG file, and all the systemLanguage values are lowercase. There are "en", "de", and "fi" clauses.

The question is how are the markup messages generated.
https://fi.wikipedia.org/wiki/Toiminnot:Merkkaukset

The relevant (local) abuse filter (61) seems still imperfect and in the beginners' phase: https://fi.wikipedia.org/wiki/Toiminnot:Väärinkäyttösuodatin/61 @Zache

Hi, the triggering filter is abuse filter 61 and it tries match if there is "{{{", "}}}" , "[[", "]]" strings in the article. It is triggering pretty easily but it has not caused any visible problems because it is tagging only and it helps to pick up the problematic edits.

https://fi.wikipedia.org/w/index.php?title=Etelä-Afrikan_presidentti&diff=17089914&oldid=17089177

" Viittausvirhe: Virheellinen <ref>-elementti; viitettä southafricapresident ei löytynyt"

https://fi.wikipedia.org/w/index.php?title=Sara_Ahde&curid=864251&diff=17088876&oldid=17087588

"{{{kuvateksti}}}"

https://fi.wikipedia.org/w/index.php?title=Widerøe&oldid=17082161

"{{{kuvateksti}}}"

However there was genuine bug too. It didn't survive from the inline mathml and i fixed that.

https://fi.wikipedia.org/w/index.php?title=Viskositeetti&curid=64843&diff=17084740&oldid=16330372
https://fi.wikipedia.org/w/index.php?title=Paraabeli&diff=16870921&oldid=16113449

I suspect that there is other same kind problems with the graphs and kartographer tags though and need to check those.

@Perhelion The relevant (local) abuse filter (61) seems still imperfect and in the beginners' phase.

Can you be more specific?

I agree that in the end the filter might be broken because it tries to do something that is more or less impossible to do but I didn't really catch what specific problem you were referring to.

Can you be more specific?

Unfortunately no, for me all the taggings are false.

If you could omit the topic reason of |lang=fi that would be very good and we could close this task.

Reason for the |lang=fi is that the filter doesn't match to change but to the full content of the page. Eg the concept is that if there is visible wikicode to the reader then the filter will trigger. However the reason for the visible wikicode doesn't need to be the edit, but the error can already be in the article.

This is not a bug, but a feature because you can't test this from abuse filters diff variables but only from the full text.

matej_suchanek subscribed.

This should be reported to local AbuseFilter maintainers, only those can fix the problem.