Page MenuHomePhabricator

Implement fallback handling in Kartotherian's language selection
Closed, ResolvedPublic

Description

Once T187595: Implement a language selection processing step for vector tiles is done, we need to add fallback handling. We can get the fallback info from CLDR, but it might be better to reference or copy MediaWiki's fallback data, because of differences in fallback choices (e.g. Ukranian) and language codes in some cases.

Event Timeline

Catrope triaged this task as Lowest priority.Feb 16 2018, 11:29 PM
Catrope created this task.

Just FYI, Kartotherian babel already supports the fallback. The big question is actually decide what to fall back to for each language. Currently it simply accepts a dictionary of language -> [ fallback chain ]

jmatazzoni raised the priority of this task from Lowest to High.Feb 26 2018, 11:56 PM

@Yurik seems like something that should be sourced from Language::getFallbacksFor() ?

It seems to already take its fallbacks from CLDR through https://github.com/kartotherian/language-scripts with an optional .json file for specific overrides.

Right now, there's no way to extract fallbacks through our API, until T190129: Consolidate language metadata into a 'language-data' library and use in MediaWiki is done, which we should support so we have a proper solution for the long term.

Strategy for a relatively quick fix for the moment:

  • Create the language fallback definition using the script from Intuition to get the available data from MediaWiki's definitions.
  • Add that file to kartotherian/babel and use it as the fallback in the LanguagePicker

Working on a PR for this.

PR merged.
https://github.com/kartotherian/babel/pull/4

Note to QA: This is a background step for the moment, so there's nothing yet to test. However, when the parent task is done, testing should include making sure language fallbacks work for the map labels.