Page MenuHomePhabricator

⛓ Ensure language fallback works for labels of linked entities
Open, Needs TriagePublic8 Estimated Story Points

Description

We want to add the language fallback functionality to GraphQL but make it optional, i.e., it is NOT the default but there is a new field added to the schema that users can explicitly request for.

New field schema in SDL:

  # ...
  labelWithLanguageFallback(languageCode: LanguageCode!): LabelWithLanguage
}

type LabelWithLanguage {
  languageCode: LanguageCode!
  value: String!
}

The user can ask for the label in a certain language and they get back a value and a language code. This language code is either the one they asked for if a label in that language exists, or the language code of the label it fell back to. If there weren't any labels for the languages in the fallback chain, it returns null.

This new field would go into any types that implement LabelProvider. Not sure about the name of the return type - LabelWithLanguage vs LabelInLanguage?

Event Timeline

Notes from polishing:

  • Maybe this needs a new field language_fallback?
  • Question - wouldn't people always want that to be yes?
  • Would also need to give the language code of the fallback language
  • Default on or off? (if we stick with the way REST API was done, the default will be off) - we decided that we'll have it default turned off
WMDE-leszek set the point value for this task to 8.Feb 26 2026, 11:25 AM
WMDE-leszek moved this task from Polished to Ready for planning on the Wikibase Reuse Team board.

Here's my suggestion for the schema of this new field:

  # ...
  labelWithLanguageFallback(languageCode: LanguageCode!): LabelWithLanguage
}

type LabelWithLanguage {
  languageCode: LanguageCode!
  value: String!
}

The user can ask for the label in a certain language and they get back a value and a language code. This language code is either the one they asked for if a label in that language exists, or the language code of the label it fell back to. If there weren't any labels for the languages in the fallback chain, it returns null.

This new field would go into any types that implement LabelProvider. Not sure about the name of the return type - LabelWithLanguage vs LabelInLanguage?

Jakob_WMDE renamed this task from Ensure language fallback works for labels of linked entities to ⛓ Ensure language fallback works for labels of linked entities.Thu, Apr 2, 7:56 AM