Page MenuHomePhabricator

api.php?uselang=sr shows language converter syntax in the HTML
Open, Needs TriagePublicBug

Event Timeline

Fomafix created this task.Oct 27 2018, 8:01 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 27 2018, 8:01 PM

I see /w.api.php with -{R|...}-. I no see /w/api.php?uselang=en with -{R|...}-.

Fomafix added a comment.EditedOct 27 2018, 8:32 PM

Are use logged in and which user interface language code do you use?

Are use logged in and which user interface language code do you use?

Yes. Serbian.

Class Parser calls

$this->getTargetLanguage()->getConverter()->markNoConversion( $url )

For language code sr-ec this executes FakeConverter::markNoConversion.
For language code sr this executes LanguageConverter::markNoConversion which adds the -{R|...}-.

Change 470255 had a related patch set uploaded (by Fomafix; owner: Fomafix):
[mediawiki/core@master] Parser: Apply markNoConversion only when language conversion is active

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

Anomie added a subscriber: Anomie.Oct 29 2018, 4:30 PM

I note this came up previously as T74875: Superfluous -{R| }- appears on https://zh.wikipedia.org/w/api.php around links, but that was closed after someone claimed it didn't happen anymore.

Another fix might be to parse the API help as content rather than interface, by calling ->setInterfaceMessageFlag( false ) on the messages.

Anomie moved this task from Unsorted to Needs Review on the MediaWiki-API board.
Fomafix changed the subtype of this task from "Task" to "Bug Report".Mar 2 2019, 11:04 AM

Change 470255 had a related patch set uploaded (by Fomafix; owner: Fomafix):
[mediawiki/core@master] Parser: Apply markNoConversion only when language conversion is active

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