Skip to content

Conversation

@Gaubee
Copy link
Contributor

@Gaubee Gaubee commented Dec 25, 2025

Summary

Add compile-time detection of non-existent translation keys using i18next TypeScript integration.

Changes

  • Add src/i18n/i18next.d.ts type declaration file that imports all namespace JSON types
  • Fix all translation key usages across 30+ files to be type-safe
  • Add missing translation keys detected by type checking:
    • security.password, security.walletLock.verifyTitle, security.passwordConfirm.verifying
    • security.twoStepSecret.confirmTitle
    • common.verifying, common.confirm
    • authorize.passwordConfirm.title
  • Refactor dynamic key patterns (e.g., labelKey) to use useMemo with direct t() calls
  • Ensure proper namespace declarations in useTranslation hooks

Benefits

  • Compile-time safety: TypeScript will now catch typos in translation keys
  • IDE autocomplete: Get suggestions for valid translation keys
  • Refactoring support: Renaming keys will show errors in all usages

Testing

  • All 1421 tests pass
  • TypeScript check passes with 0 errors

- Add src/i18n/i18next.d.ts type declaration file
- Fix all translation key usages to be type-safe
- Add missing translation keys detected by type checking
- Refactor dynamic key patterns to use useMemo with direct t() calls
- Ensure proper namespace declarations in useTranslation hooks

This enables compile-time detection of non-existent translation keys.
@Gaubee Gaubee merged commit a37375f into main Dec 25, 2025
5 checks passed
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.

2 participants