Page MenuHomePhabricator

Allow removal of terms for unsupported language codes from Items
Closed, ResolvedPublic

Description

Problem:
The Language and Product Localization team is working on deprecating certain language codes for a long time already. A blocker to doing this is the existing labels, descriptions and aliases in those languages in Wikidata. One example is T394877.
Removing the language codes is made harder than it needs to be be because Wikibase does not let you remove labels from an Item if the language code has been removed. We should fix this by allowing the removal of labels, descriptions and aliases even if the language code for them is no longer supported.

BDD
GIVEN an Item with existing terms for a given language code
AND that language code is not supported by the Wikibase instance
WHEN removing the terms in that language code
THEN the terms in that language code are removed instead of throwing an error

Acceptance criteria:

  • terms for deprecated/unsupported language codes can be removed

Event Timeline

Lydia_Pintscher renamed this task from Wikidata Ticket Template to Allow removal of terms for unsupported language codes from Items.Aug 27 2025, 5:08 PM
Lydia_Pintscher triaged this task as High priority.

It seems like resolving T284808 is a necessary precondition for the situation presented in this task.

Change #1182177 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/Wikibase@master] WIP: Allow removing terms in unsupported languages

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

Change #1210645 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/Wikibase@master] WIP: Further improve wbeditentity summaries for terms

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

It seems like resolving T284808 is a necessary precondition for the situation presented in this task.

I disagree. MediaWiki could also remove support for a language code altogether without a configuration variable.

Change #1210645 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Further improve wbeditentity summaries for terms

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

Change #1182177 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Allow removing terms in unsupported languages

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

The above change should be deployed to Wikidata ca. 7 January (T408280). Note that, as described in the commit message, only wbeditentity (Action API) or a full-entity PATCH (REST API) can remove terms in unsupported languages, so the desktop termbox won’t work. (I think the mobile termbox would actually work, though I haven’t tested it.) A dedicated bot to remove labels in no-longer-supported languages should use one of the supported API endpoints. (I think cleanup-wikidata-language-code.py should work, because it looks like pywikibot uses wbeditentity, but again I haven’t tested it.)

karapayneWMDE subscribed.

Could you please verify that the patch address your issue and if there is any additional work still left to be done? Thanks!

I can't verify this because I don't have an unsupported language code and the right API call set up for it.
I am going to close this though under the assumption that it works as expected and if not let's reopen it.