Page MenuHomePhabricator

[Task] Overhaul LanguageFallbackChainFactory, use appropriate fallback depending on context.
Open, MediumPublic

Description

LanguageFallbackChainFactory currently contains a lot of methods with an unclear purpose. It should be overhauled to cover the following use cases:

  • getFallbackChainForSiteContent() // based on site content language, and an optionally extra fallbacks from site config. Ok for cached content.
  • getFallbackChainForLanguage( $language ) // based on the given language only; can be used for cached content, if the cache is split by the given language.
  • getFallbackChainForUser( $user ) // based on user language and optionally additional user settings (like babel boxes). For non-cacheable output (skin).

On the repo, we can use getFallbackChainForLanguage( $userLanguage ) when generating cacheable page content. For anon users, $userLanguage must be the site language, since the web cache isn't split by language.

On the client, we should use getFallbackChainForSiteContent() when generating output from parser functions or Lua.

Event Timeline

daniel raised the priority of this task from to Needs Triage.
daniel updated the task description. (Show Details)
daniel changed Security from none to None.
daniel added a subscriber: daniel.
Lydia_Pintscher removed a subscriber: Unknown Object (MLST).
Jonas renamed this task from Overhaul LanguageFallbackChainFactory, use appropriate fallback depending on context. to [Task] Overhaul LanguageFallbackChainFactory, use appropriate fallback depending on context..Sep 10 2015, 3:49 PM