Page MenuHomePhabricator

Termbox should hide non-supported languages
Open, HighPublic

Description

Both desktop and new mobile termbox shouldn't show non-supported languages in either the current or historic revisions.

  • Remove from desktop termbox
    • remove from title and content of PageOutput
    • remove from ParserOutput (patches up for review)
    • remove from post load JS generated "Additional Languages"
  • Remove from mobile termbox
    • ensure unusual interface language don't show empty row
    • ensure previously valid terms aren't displayed in secondary or additional languages

Details

Related Gerrit Patches:

Event Timeline

noarave created this task.Jul 2 2019, 12:59 PM
Restricted Application removed a project: Patch-For-Review. · View Herald TranscriptJul 2 2019, 12:59 PM
Tarrow claimed this task.Aug 20 2019, 2:45 PM

Assigning this to myself. I'm just in the process of working out where we should be making changes

Tarrow updated the task description. (Show Details)Aug 20 2019, 3:56 PM

For the current desktop termbox it appears that we already check when building the termbox with the user's language that all of those languages are valid WikibaseContent languages:

Non-valid language are filtered out here: extensions/Wikibase/repo/includes/Hooks/OutputPageBeforeHTMLHookHandler.php:239
Which means that they are not then later iterated over in extensions/Wikibase/repo/includes/ParserOutput/PlaceholderExpander/EntityViewPlaceholderExpander.php

It looks at first glance to me like the additional "invalid" languages are added client side.

Looks like that is partially true. I also missed that due to extensions/Wikibase/repo/includes/Hooks/OutputPageBeforeHTMLHookHandler.php:274 the language of the OutputPage is also always included even if it is not valid. This is then used to generate the language for the page title, and headline term.

e.g. if we append &uselang=foobarbaz to the url.

Tarrow updated the task description. (Show Details)Aug 21 2019, 7:56 AM

Change 531924 had a related patch set uploaded (by Jakob; owner: Jakob):
[mediawiki/extensions/Wikibase@master] Add service for looking up a user's preferred languages

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

Change 531938 had a related patch set uploaded (by Jakob; owner: Jakob):
[mediawiki/extensions/Wikibase@master] Wire up UserPreferredContentLanguagesLookup with OutputPageBeforeHTMLHookHandler

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

Change 531924 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Add service for looking up a user's preferred languages

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

Change 532708 had a related patch set uploaded (by Jakob; owner: Jakob):
[mediawiki/extensions/Wikibase@master] UserPreferredContentLanguagesLookup: better method param name

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

Tarrow updated the task description. (Show Details)Aug 29 2019, 10:19 AM

Change 533183 had a related patch set uploaded (by Tarrow; owner: Tarrow):
[mediawiki/extensions/Wikibase@master] Ensure EntityTermsViewFactory builds with valid Terms Languages

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

Change 533497 had a related patch set uploaded (by Tarrow; owner: Tarrow):
[mediawiki/extensions/Wikibase@master] Introduce ContentLanguagesFallbackChainFilterer

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

Change 533913 had a related patch set uploaded (by Tarrow; owner: Tarrow):
[mediawiki/extensions/Wikibase@master] Use only Terms languages in EntityTermsViews FallbackChains

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

Change 533183 abandoned by Tarrow:
Ensure EntityTermsViewFactory builds with valid Terms Languages

Reason:
It seems that useful bit of this patch has been supplanted by: I79f735c7a07760bd1a85c9e39bed5168d2092390

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

Change 533941 had a related patch set uploaded (by Tarrow; owner: Tarrow):
[mediawiki/extensions/Wikibase@master] FingerprintableEntityMetaTagsCreator gets just Term Languages

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

Tarrow updated the task description. (Show Details)Sep 2 2019, 4:37 PM

Change 532708 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] UserPreferredContentLanguagesLookup: better method param name

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

Change 533497 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Introduce ContentLanguagesFallbackChainFilterer

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

Change 531938 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Wire up UserPreferredContentLanguagesLookup with OutputPageBeforeHTMLHookHandler

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

Change 534534 had a related patch set uploaded (by Tarrow; owner: Tarrow):
[mediawiki/extensions/Wikibase@master] Add TermsContentLanguages to JS config

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

alaa_wmde removed Tarrow as the assignee of this task.Sep 12 2019, 11:47 AM
alaa_wmde moved this task from Incoming to Ready to pick up on the Wikidata-Campsite board.
alaa_wmde added a subscriber: alaa_wmde.

Moving back as it might not be continued on for a week or two

Addshore triaged this task as High priority.Tue, Oct 29, 1:39 PM
Addshore removed a project: Wikidata-Campsite.