Page MenuHomePhabricator

Consider language variants when delivering content
Open, Needs TriagePublic

Description

When content such as tech news is available in a language variant such as Brazilian Portuguese (pt-br) but lacks a translation into Portuguese (pt), the MassMessage system publishes the English version on Portuguese Wikipedia. The expected result would be to consider the language variant as a fallback and show the content in Brazilian Portuguese instead.

Content available in Brazilian PortuguesePublished content in English on Portuguese Wikipedia

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJul 26 2018, 10:37 AM

To the best of my knowledge, this is neither caused by MassMessage nor Translate. I believe (@Johan can correct me if I'm wrong) there's a Lua module that generates a giant #switch parser function to send out localized messages.

I'm also not sure whether pt is supposed to fallback to pt-br.

The same behavior is seen if you translate a [[MediaWiki:Message]] into [[MediaWiki:Message/pt-br]] but not [[MediaWiki:Message/pt]], and the UI is set to pt.

The same behavior is seen if you translate a [[MediaWiki:Message]] into [[MediaWiki:Message/pt-br]] but not [[MediaWiki:Message/pt]], and the UI is set to pt.

It's more complicated than that (e.g. it depends on whether Message is defined in i18n files too).

In MediaWiki language files pt falls back to pt-br and en, pt-br falls back to pt and en.