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.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptFeb 16 2018, 11:29 PM
Yurik added a subscriber: Yurik.Feb 16 2018, 11:52 PM

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
TheDJ added a subscriber: TheDJ.Mar 15 2018, 10:09 AM

@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.

Amire80 moved this task from Untriaged to Fallback on the I18n board.Mar 18 2018, 2:06 PM

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.

Etonkovidova closed this task as Resolved.Mar 28 2018, 7:28 PM