Skip to content

chore(i18n): drop 178 dead translation keys from all locales#3867

Merged
koala73 merged 1 commit into
koala73:mainfrom
shubham1206agra:remove-unused-translations
May 26, 2026
Merged

chore(i18n): drop 178 dead translation keys from all locales#3867
koala73 merged 1 commit into
koala73:mainfrom
shubham1206agra:remove-unused-translations

Conversation

@shubham1206agra

Copy link
Copy Markdown
Contributor

Summary

Static-analysis sweep against literal t() calls, dynamic key construction, pluralization variants, and substring use in lookup tables / property-access scripts. 178 keys had no reference in src/ and no consumer outside src/.

Also drops 13 stale extras that existed only in translations (8 components.economic.* + panels.{liveYouTube,pinnedWebcams} universally, 5 more under deckgl.layers / modals.countryIntel in nl/pt/sv) — translate-locales.mjs would otherwise re-add them.

Preserved: shell.offline{Title,Message,Retry} (read directly by scripts/sync-offline-translations.mjs into public/offline.html) and the components.cii._methodologyLink_translatorNote sidecar.

Verification: all 21 JSON files validate; translate-locales --dry-run shows only the pre-existing 6-key untranslated gap; sync-offline diff on public/offline.html is empty.

Type of change

  • Bug fix
  • New feature
  • New data source / feed
  • New map layer
  • Refactor / code cleanup
  • Documentation
  • CI / Build / Infrastructure

Affected areas

  • Map / Globe
  • News panels / RSS feeds
  • AI Insights / World Brief
  • Market Radar / Crypto
  • Desktop app (Tauri)
  • API endpoints (/api/*)
  • Config / Settings
  • Other: None, dead code

Checklist

  • Tested on worldmonitor.app variant
  • Tested on tech.worldmonitor.app variant (if applicable)
  • New RSS feed domains added to api/rss-proxy.js allowlist (if adding feeds)
  • No API keys or secrets committed
  • TypeScript compiles without errors (npm run typecheck)

Screenshots

NA

@vercel

vercel Bot commented May 23, 2026

Copy link
Copy Markdown

@shubham1206agra is attempting to deploy a commit to the World Monitor Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added the trust:safe Brin: contributor trust score safe label May 23, 2026
@greptile-apps

greptile-apps Bot commented May 23, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR removes 178 unused translation keys from all 21 locale files, plus 13 stale extras that existed only in translated files with no corresponding source reference. The cleanup was validated by static analysis against src/ and cross-checked against script consumers (sync-offline-translations.mjs), with preserved keys for offline fallback and the CII methodology sidecar note.

  • 178 dead keys removed universally — spot-checks of representative removals (app.title, modals.downloadBanner.dismiss, modals.search.hint*, components.breakingNews.enableNotifications, components.status.dataFeeds, etc.) confirm no references in src/.
  • 13 locale-only extras removedpanels.liveYouTube / panels.pinnedWebcams universally; deckgl.layers.laborMarket|metroUnemployment and modals.countryIntel.geocodeFailed|retryBtn|closeBtn only from nl/pt/sv (those 3 keys are consumed under the countryBrief.* namespace, not modals.countryIntel, in all other locales).
  • EnergyCrisisPanel uses a hardcoded infoTooltip string in its constructor, confirming the removed components.energyCrisis.infoTooltip key was truly orphaned.

Confidence Score: 5/5

Pure dead-code removal across locale files only — no logic, component, or API changes. Safe to merge.

Every sampled removal was verified against grep results across src/: app.title, modals.downloadBanner.dismiss/title, modals.search.hint variants, components.breakingNews.enableNotifications, components.status.dataFeeds, components.energyCrisis.infoTooltip (panel uses a hardcoded string), and the nl/pt/sv-only deckgl.layers and modals.countryIntel extras. The preserved offline keys and CII sidecar note are intact. No src-referenced key was dropped.

No files require special attention. nl.json, pt.json, and sv.json had 5 extra locale-only keys removed beyond the universal set, but all are confirmed unused.

Important Files Changed

Filename Overview
src/locales/en.json Reference locale — 178 keys removed, all verified as unreferenced in src/. Preserved keys (shell.offline*, cii._methodologyLink_translatorNote) are intact.
src/locales/nl.json Removes the same 178 universal keys plus 5 nl-only extras (deckgl.layers.laborMarket/metroUnemployment and modals.countryIntel.geocodeFailed/retryBtn/closeBtn) that had no src references.
src/locales/pt.json Same as nl.json — 178 universal keys plus 5 pt-only extras removed; no src references confirmed.
src/locales/sv.json Same as nl.json / pt.json — 178 universal keys plus 5 sv-only extras removed; no src references confirmed.
src/locales/ar.json Universal 178-key cleanup applied; no locale-specific extras removed.
src/locales/de.json Universal 178-key cleanup applied; no locale-specific extras removed.
src/locales/fr.json Universal 178-key cleanup applied; no locale-specific extras removed.
src/locales/ja.json Universal 178-key cleanup applied; no locale-specific extras removed.
src/locales/zh.json Universal 178-key cleanup applied; no locale-specific extras removed.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Static Analysis Sweep] --> B{Key referenced in src/?}
    B -- Yes --> C[Keep key in all locales]
    B -- No --> D{Locale-only extra?}
    D -- Yes, universal --> E[Remove from all 21 locales]
    D -- Yes, nl/pt/sv only --> F[Remove from nl, pt, sv only]
    D -- No --> G[Remove 178 dead keys universally]
    C --> H[shell.offline* preserved\ncii._methodologyLink preserved]
    E --> I[panels.liveYouTube\npanels.pinnedWebcams\n8x components.economic.*]
    F --> J[deckgl.layers.laborMarket\ndeckgl.layers.metroUnemployment\nmodals.countryIntel.geocodeFailed\nmodals.countryIntel.retryBtn\nmodals.countryIntel.closeBtn]
    G --> K[178 keys removed\nfrom 21 locale files]
Loading

Reviews (1): Last reviewed commit: "chore(i18n): drop 178 dead translation k..." | Re-trigger Greptile

Static-analysis sweep against literal t() calls, dynamic key construction,
pluralization variants, and substring use in lookup tables / property-access
scripts. 178 keys had no reference in src/, scripts/, server/, shared/, api/,
public/, or tests/, plus 13 stale extras that existed only in non-English
translations (8 components.economic.* + panels.{liveYouTube,pinnedWebcams}
universally, 5 more under deckgl.layers / modals.countryIntel in nl/pt/sv).
translate-locales.mjs would otherwise re-add them on next backfill.

Coverage: all 22 locales (en + 20 originals + hu added in koala73#3857).

Preserved: shell.offline{Title,Message,Retry} (read by
scripts/sync-offline-translations.mjs into public/offline.html) and the
components.cii._methodologyLink_translatorNote sidecar.

Test-contract: drop 'createWithAi' and 'changeAccent' from REQUIRED_KEYS in
tests/widget-builder.test.mjs — both keys lost their last production
reference in 80c3751 and 47f0dd1 respectively; the contract was stale.

Verification: all 22 JSON files validate; widget-builder test 203/203;
sync-offline runs clean (no public/offline.html diff); all 21 locales
have exact en-parity except CLDR plural-cohort siblings (signals_few/_many/
_zero etc) added by koala73#3908, which are legitimate.

Co-authored-by: Elie Habib <[email protected]>
@koala73
koala73 force-pushed the remove-unused-translations branch from a41b009 to 0429dc2 Compare May 26, 2026 05:03
@koala73
koala73 merged commit 6313838 into koala73:main May 26, 2026
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

trust:safe Brin: contributor trust score safe

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants