Messages: find and remove English messages that no component uses

Open
#535 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
73/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
github-actions, nextjs, typescript

Research direction

Start with lib/i18n/messages/en.ts, lib/i18n/messages.test.ts, and lib/i18n/dynamic-key.ts; inspect how catalogs and runtime-built keys are represented. Then locate the scripts and CI configuration to add the warning check, and read docs/translating.md for the expected documentation style. Done when pnpm check:messages runs in CI, unused keys are removed from all four catalogs and listed with byte savings in the PR, and the tests pass.

Written by the indexing model from the issue text.

Description

area: docs difficulty: easy enhancement good first issue help wanted performance v2.0.0

Summary

The English catalog is in every route's first load, so every unused message costs bytes everywhere. A script can list the keys in en.ts that no source file refers to (allowing for keys built from a prefix) so they can be removed from all four catalogs.

Part of the 2.0.0 plan: fewer, better and fully tested studios, on a calmer and faster site.

Where to look

  • lib/i18n/messages/en.ts and lib/i18n/messages.test.ts
  • scripts/ (a place for the check)
  • lib/i18n/dynamic-key.ts (keys built at run time)

Behaviour

  • Write a script that lists keys with no reference and no matching dynamic prefix, and run it in CI as a warning.
  • Remove the unused keys from en, es, fr and hi.
  • Do not remove a key used through a template string: list those prefixes in one place.

Acceptance criteria

  • The script runs with pnpm check:messages and is explained in docs/translating.md.
  • The removed keys are listed in the pull request, with the bytes saved.
  • All tests pass.

Getting started: fork the repo, then pnpm install and pnpm dev (Node 22+, pnpm 11, no API keys). Before opening a PR, run pnpm typecheck && pnpm test && pnpm lint && pnpm format:check && pnpm check:dashes && pnpm build (CI fails on unformatted files, so pnpm format first). See CONTRIBUTING.md and the first contribution walkthrough.

Everything needed is in the repository. This doesn't need maintainer access, secrets or paid services. Comment below to claim it, and ask questions here any time.

Dominant language
TypeScript
Stars
11
Forks
3
Avg merge
6h 9m
Merged PRs (30d)
73

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from yakew7/DesignHub

All issues in yakew7/DesignHub

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.