Page MenuHomePhabricator

Language fallback should be optional
Closed, DeclinedPublic

Description

Now that language fallback is applied to mw.wikibase.label() as well (rEWBA9efbaaf23d23d202aa78df86b4d496f6d78f0bd7), we were able to reduce missing labels in cswiki to from 4,000 to 400. That would be nice if it didn't cause data to be shown in a different language from the content language. This could result in complete banning Wikidata data from some client wikis.

I suggest to have true/false check as the second parameter, meaning whether to choose other languages in the fallback chain.

A workaround for this is loading each entity which could cause performance issues.

Event Timeline

Ok so I would really like to avoid having to make this optional but if it needs to happen then it needs to happen.

If we make it optional we have at least two ways:

  • per project (either a project has language fallbacks or not)
  • per function call (you specify if you want fallbacks for every Lua call)

The latter seems like a really bad idea to me because it introduces a huge amount of complexity. I _really_ want to avoid that.

I can't see any one-size-fits-all solution here. It must be possible to get to the label in the native language somehow.

Add a language code to mw.wikibase.label, and if it is missing use the fallback.

I think we should rather go for T143094 which allows consumers to take more control of what they're showing, as this flag might be confusing, especially on multilingual wikis (where the first language differs by user language).