Page MenuHomePhabricator

Consider language variants when delivering content
Closed, ResolvedPublic

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
Screen Shot 2018-07-26 at 12.33.49.png (488×1 px, 174 KB)
Screen Shot 2018-07-26 at 12.34.34.png (327×1 px, 87 KB)

Event Timeline

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.

Nikerabbit claimed this task.

I'm sure this is fixed. We can now send translatable pages and it uses the language fallbacks.