Page MenuHomePhabricator

Remove unused i18n messages from PersonalDashboard
Closed, ResolvedPublic2 Estimated Story Points

Description

Using the following script, it would appear there are a lot of i18n messages we are no longer using and so they should be removed:

find i18n -name 'en.json' -type f | while read -r file; do
  echo "== Checking $file =="
  for key in $(jq -r 'keys[] | select(. != "@metadata")' "$file"); do
    grep -rqF "$key" --include='*.php' --include='*.js' --include='*.json' --include='*.vue' \
      --exclude-dir=i18n --exclude-dir=node_modules --exclude-dir=vendor . \
      || echo "unused: $key"
  done
done

This doesn't account for dynamically constructed message keys, but those should always be documented anyway (1, 2).

The work involved here might involve tediously checking for dynamic messages, and documenting those with the usual The follow messages are used here: … comments.


Related: T224429, T338091

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
MusikAnimal changed the task status from Open to In Progress.Aug 6 2026, 8:34 PM
MusikAnimal claimed this task.
MusikAnimal moved this task from Ready to In Progress on the Moderator-Tools-Team (Kanban) board.

We should do the same for CSS classes, too, as per https://www.mediawiki.org/wiki/Manual:Coding_conventions#Dynamic_identifiers

I'll make a separate patch for that but add it to this task

Change #1322141 had a related patch set uploaded (by MusikAnimal; author: MusikAnimal):

[mediawiki/extensions/PersonalDashboard@master] Remove unused i18n messages, and add a checker to keep them out

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

Change #1322204 had a related patch set uploaded (by MusikAnimal; author: MusikAnimal):

[mediawiki/extensions/PersonalDashboard@master] Document dynamically constructed CSS classes, and spell out more keys

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

Change #1322141 merged by jenkins-bot:

[mediawiki/extensions/PersonalDashboard@master] Remove unused i18n messages, and add a checker to keep them out

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

Change #1322204 merged by jenkins-bot:

[mediawiki/extensions/PersonalDashboard@master] Document dynamically constructed CSS classes, and spell out more keys

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

MusikAnimal moved this task from QA to Done on the Moderator-Tools-Team (Kanban) board.

Doesn't really need QA