Page MenuHomePhabricator

Termbox should hide non-supported languages
Closed, ResolvedPublic

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 languages ("in more languages" section)
    • ensure previously valid terms aren't displayed in additional languages

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.Oct 29 2019, 1:39 PM
Addshore removed a project: Wikidata-Campsite.

Change 554537 had a related patch set uploaded (by Jakob; owner: Jakob):
[mediawiki/extensions/Wikibase@master] Filter out invalid term languages from termbox

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

Change 554835 had a related patch set uploaded (by Jakob; owner: Jakob):
[mediawiki/extensions/Wikibase@master] Filter out invalid term languages from termbox

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

Maintenance_bot moved this task from incoming to in progress on the Wikidata board.Dec 5 2019, 4:15 PM

Change 554537 abandoned by Addshore:
Filter out invalid term languages from termbox

Reason:
Abandoned in favour of https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/Wikibase/ /554835/

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

Change 534534 abandoned by Addshore:
Add TermsContentLanguages to JS config

Reason:
Abandoned in favour of https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/Wikibase/ /554835/

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

Change 533941 abandoned by Addshore:
FingerprintableEntityMetaTagsCreator gets just Term Languages

Reason:
Abandoned in favour of https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/Wikibase/ /554835/

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

Change 533913 abandoned by Addshore:
Use only Terms languages in EntityTermsViews FallbackChains

Reason:
Abandoned in favour of https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/Wikibase/ /554835/

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

Change 554835 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Filter out invalid term languages from termbox

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

Jakob_WMDE updated the task description. (Show Details)Dec 10 2019, 3:25 PM

Change 571534 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/Wikibase@master] Revert "Introduce ContentLanguagesFallbackChainFilterer"

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

I saw this revert patch come up; it's a great idea to clean up if not needed.

I see the ticket is closed but as far as I can see unsupported language can still appear in the termbox in various cases.
See for example
https://wikidata.beta.wmflabs.org/wiki/Q112?uselang=catfish
or
https://m.wikidata.beta.wmflabs.org/wiki/Q112?uselang=catfish

where the bad language is still happily pumped out.

I'm not quite sure the implication of not fixing this off hand. I've unchecked the "remove from ParserOutput (patches up for review)" box since that is where these snuck in.
Also 2/3 new termbox tickets are still unchecked so maybe this needs checking too.

I guess we need to figure out if this is actually done?

Tarrow updated the task description. (Show Details)Feb 11 2020, 5:13 PM

FWIW, Jakob’s comment at T217770#5778186 seems to mention the ?uselang “hack” as something that still needs to be cleaned up, so maybe that was never intended to be in scope of this task?

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

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