Page MenuHomePhabricator

[AUTO_LANGUAGE] does not use language fallbacks
Open, Needs TriagePublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • Set the UI language to de-formal
  • Run a query which uses [AUTO_LANGUAGE] to select labels (e.g. this query)

What happens?:

[AUTO_LANGUAGE] is replaced by the current UI language, without any fallbacks included.

In this case, de-formal is a UI-only language, so no labels are shown.

What should have happened instead?:

When replacing [AUTO_LANGUAGE] with the current UI language, fallback languages are included, so that the user sees the same labels that they would see on-wiki (e.g. here).

In this case, it should fall back to de, mul and en (see Special:MyLanguageFallbackChain)

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

Related ticket: T299525 - I don't think this is the same thing because you can manually insert fallbacks when providing specific language codes. The whole point of using [AUTO_LANGUAGE] is that we don't know what the language will be, therefore we can't include the right fallbacks ourselves.

Event Timeline

Tagging Wikidata Query UI since [AUTO_LANGUAGE] is handled there (we just replace the string before sending the query to the backend).

I suppose this would be easier to implement now than it was back in 2017 when [AUTO_LANGUAGE] was introduced, because the languageinfo API exists now and can tell us the list of fallback languages. But fetching the fallbacks would still require an async API call. Not sure if we want to do that

  1. when the user first runs a query (and then cache it as long as the page stays open – or even in local storage for a while?)
  2. when the user first opens the query GUI (on the assumption that it’ll probably be needed; and then cache it as above)
  3. when we build the query GUI, and then the fallback chains are hard-coded in the build output?

(Also, I feel like we should probably make this a separate keyword, perhaps [AUTO_LANGUAGES], to avoid breaking queries that rely on [AUTO_LANGUAGE] returning a single language code – anything with FILTER(LANG(?itemLabel) = "[AUTO_LANGUAGE]"), for example.)

ItamarWMDE subscribed.

Tagging the Product Platform on this after a quick discussion w. Leszek