Skip to content

refactor(i18n): remove the unused i18n layer - #2465

Open
Subramaniyajothi6 wants to merge 1 commit into
utksh1:mainfrom
Subramaniyajothi6:refactor/remove-dead-i18n-1864
Open

refactor(i18n): remove the unused i18n layer#2465
Subramaniyajothi6 wants to merge 1 commit into
utksh1:mainfrom
Subramaniyajothi6:refactor/remove-dead-i18n-1864

Conversation

@Subramaniyajothi6

Copy link
Copy Markdown
Contributor

Closes #1864

What I found

The issue offers two directions — wire i18n in as a pilot, or remove the layer. Surveying it first:

  • The only reference anywhere in the frontend is App.tsx importing I18nProvider to wrap the tree.
  • useTranslation has zero call sites.
  • Every UI string is hardcoded English.
  • Only an en locale exists; translations carries just common and nav.
  • setLocale is exposed through context, but no UI can reach it — there is no locale switcher.

So this is scaffolding for a feature that was never built, not a partially-adopted one.

(Small correction to the issue text: the file is at frontend/src/components/I18nContext.tsx, not frontend/src/context/.)

Why removal rather than a pilot

Reintroducing i18n properly when localisation is actually planned is easier than maintaining a half-present abstraction in the meantime. The current state is worse than having nothing: a provider in the tree and a useTranslation export imply strings are already translatable, when adopting it would still mean migrating every page, adding the missing keys, and building the switcher.

That said, this is a product call as much as a code one. If localisation is on the roadmap and you would rather keep the scaffolding, say so and I will close this in favour of the pilot instead — the survey above is the same either way.

Changes

  • Delete frontend/src/components/I18nContext.tsx
  • Delete frontend/testing/unit/components/I18nContext.test.tsx (tests for the deleted module)
  • Unwrap I18nProvider from App.tsx

Nothing else referenced it, so nothing else changes.

Verification

  • Swept the whole repo — i18n, useTranslation, setLocale, I18nProvider — across src, testing, docs, and configs including quality-gate.cjs. Zero references remain.
  • tsc --noEmit — clean
  • quality-gate.cjs — 13 passed, 0 failed (its 1 warning is a pre-existing 2000ms animation)
  • Full vitest run64 files, 566 tests passed

That last number is worth stating precisely: main runs 65 files / 575 tests. The difference is exactly the one deleted test file and its 9 tests, which is what confirms nothing else depended on the layer.

@utksh1 utksh1 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removes unused i18n layer. Clean refactor.

I18nContext exported useTranslation and t(), but nothing ever called them.
The only reference anywhere in the frontend was App.tsx importing
I18nProvider to wrap the tree. Every UI string is hardcoded English, only
an 'en' locale exists, translations carries just 'common' and 'nav', and
setLocale is exposed through context with no UI able to reach it.

So the layer is scaffolding for a feature that was never built. Removing it
rather than wiring it in: reintroducing i18n properly when localisation is
actually planned is easier than maintaining a half-present abstraction that
looks supported but is not, and whose presence implies strings are already
translatable when they are not.

Deletes the context and its test, and unwraps the provider from App.tsx.
No other module referenced it, so nothing else changes.

Verified: no i18n reference remains anywhere in src, tests, docs or configs;
tsc clean; quality gate 13 passed / 0 failed; full vitest 64 files / 566
tests pass -- 9 fewer than main's 575, which is exactly the deleted file.
@Subramaniyajothi6
Subramaniyajothi6 force-pushed the refactor/remove-dead-i18n-1864 branch from 4f1c02c to 7793420 Compare August 6, 2026 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[#88] No XSS found, but i18n layer is entirely dead code

2 participants