Page MenuHomePhabricator

Use some of the fallback language chain in ResourceLoaderImage
Closed, ResolvedPublic1 Estimated Story Points

Description

In WikiEditor, we use mw.language.getFallbackLanguageChain() for multi-lingual icons. As a result, an icon specified to be used in 'de' will also get used by 'de-formal'.

The fallback chain for 'de-formal' is [ 'de-formal', 'de', 'en' ], so we'd probably want to use a chain that doesn't include 'en'.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change 423175 had a related patch set uploaded (by Esanders; owner: Esanders):
[mediawiki/core@master] Use fallback languages in ResourceLoaderImage

https://gerrit.wikimedia.org/r/423175

'de-at' has as fallback chain [ 'de-at', 'de', 'en' ] and
'en-gb' has as fallback chain [ 'en-gb', 'en' ].

In the first case the 'en' should removed to fallback to the default image instead of the English image if a special image for the languages 'de-at' and 'de' are not present.
In the second case the 'en' should not removed to fallback to the English image if a special image for the languages 'en-gb' is not present.

WikiEditor do this with a hacky check: https://phabricator.wikimedia.org/diffusion/EWED/browse/master/modules/jquery.wikiEditor.js;ada9f5f7929174a0c2a82e1426c7474a33ef39bf$20-25

A better solution would be a new fallback chain without default fallback to English to allow to select the own default action.

Note that the logic for English variant fallbacks doesn't actually kick in in practice right now, since we have them "hardcoded" in the icon definitions – search for en,en-ca,en-gb. We could remove that now if we like, though.

Change 423175 merged by jenkins-bot:
[mediawiki/core@master] Use fallback languages in ResourceLoaderImage

https://gerrit.wikimedia.org/r/423175

Change 424043 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[oojs/ui@master] Remove icon overrides for 'en-ca', 'en-gb' when 'en' suffices

https://gerrit.wikimedia.org/r/424043

Change 424043 merged by jenkins-bot:
[oojs/ui@master] Remove icon overrides for 'en-ca', 'en-gb' when 'en' suffices

https://gerrit.wikimedia.org/r/424043

Deskana set the point value for this task to 1.Apr 10 2018, 11:10 AM