Skip to content

chore(renderer): remove the dead i18n module cluster - #101

Merged
mrsibe merged 1 commit into
mainfrom
chore/remove-dead-i18n
Sep 25, 2026
Merged

mrsibe merged 1 commit into
mainfrom
chore/remove-dead-i18n

Conversation

@mrsibe

@mrsibe mrsibe commented Sep 25, 2026

Copy link
Copy Markdown
Owner

What does this PR do?

Deletes three renderer modules that were unreachable from every entry point, so the app no longer ships and maintains a second, drifted i18n implementation that looks live.

Why?

  • src/renderer/src/components/LanguageSelector.tsx
  • src/renderer/src/components/Versions.tsx
  • src/renderer/src/lib/i18n.ts

lib/i18n.ts was a complete second i18n implementation — its own locale cache, its own useTranslation, t, getTranslation, formatMessage and pluralize — while the app uses i18next through src/renderer/src/i18n.ts. Its only importer was LanguageSelector, which was itself unused; preloadLocales had no consumer at all. Versions.tsx rendered the Electron/Chromium/Node versions and was never mounted.

Dead i18n code that looks live is a trap: it invites someone to "fix" a translation in a module the app never calls. The second implementation had already drifted — its Namespace union omits anki and shortcuts, which exist in locales/ and in i18n.ts.

Related issue

Fixes #87

What changed?

  • Deleted src/renderer/src/components/LanguageSelector.tsx
  • Deleted src/renderer/src/components/Versions.tsx
  • Deleted src/renderer/src/lib/i18n.ts

Nothing else. lib/ keeps dragLock.ts, platform.ts and utils.ts, so the directory stays.

How was this tested?

Verified nothing references the deleted modules before removing them:

$ grep -rn "LanguageSelector\|lib/i18n\|preloadLocales" . \
    --exclude-dir=node_modules --exclude-dir=out --exclude-dir=dist --exclude-dir=.git
(none)

Then, on a clean checkout of this branch:

Command Result
npm run typecheck clean (node + web + test)
npm run lint 0 errors, 109 warnings — the pre-existing count, unchanged
npm test 84 pass, 0 fail
npm run check:design no violations
npm run build succeeds (✓ built in 5.24s)

No UI or behaviour change, so there is nothing to screenshot.

Checklist

  • I have reviewed my own changes.
  • npm run typecheck passes.
  • npm run build passes.
  • I have tested the affected user workflow. — no user-facing workflow is affected; the modules had no callers
  • I have not included unrelated changes.
  • I have updated documentation when necessary. — no documentation referenced these modules

Desktop / build changes

  • Not applicable

Three renderer modules were unreachable from every entry point:
`LanguageSelector`, `Versions`, and `lib/i18n.ts`. The evidence is not a
judgement call — a repo-wide search for each name returns its own definition and
nothing else:

    $ grep -rn "LanguageSelector\|lib/i18n\|preloadLocales" .
    (none)

`lib/i18n.ts` was a second, independent i18n implementation — its own locale
cache, its own `useTranslation`, `t`, `getTranslation`, `formatMessage` and
`pluralize` — while the app actually uses `i18next` through
`src/renderer/src/i18n.ts`. Its only importer was `LanguageSelector`, which was
itself unused; `preloadLocales` had no consumer at all. `Versions.tsx` rendered
the Electron/Chromium/Node versions and was never mounted.

Dead i18n code that looks live is a trap: it invites someone to "fix" a
translation in a module the app never calls. The second implementation had
already drifted from the live one — its `Namespace` union omits `anki` and
`shortcuts`, which exist in `locales/` and in `i18n.ts`.

`lib/` keeps `dragLock.ts`, `platform.ts` and `utils.ts`, so the directory stays.

No behaviour change: nothing imported any of the three modules, and typecheck,
lint, `npm test` and the production build are unaffected.

Fixes #87
@github-actions github-actions Bot added the skip-changelog Exclude from generated release notes label Sep 25, 2026
@mrsibe
mrsibe merged commit 65b1ea7 into main Sep 25, 2026
4 checks passed
@mrsibe
mrsibe deleted the chore/remove-dead-i18n branch September 25, 2026 04:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-changelog Exclude from generated release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Chore] Delete the dead i18n module cluster (LanguageSelector, Versions, lib/i18n)

1 participant