Skip to content

feat(i18n): add TypeScript type safety for translations - #117

Merged
Gaubee merged 2 commits into
mainfrom
feat/i18n-type-safety
Dec 26, 2025
Merged

Gaubee merged 2 commits into
mainfrom
feat/i18n-type-safety

Conversation

@Gaubee

@Gaubee Gaubee commented Dec 26, 2025

Copy link
Copy Markdown
Contributor

Summary

Add TypeScript type checking for i18n translation keys using i18next CustomTypeOptions.

Changes

  • Add src/i18n/i18next.d.ts with type definitions for all namespaces
  • Sync missing translation keys across all locales
  • Now t('missingKey') will cause TypeScript error if key doesn't exist

Benefits

  • Compile-time detection of missing translation keys
  • IDE autocomplete for translation keys
  • Prevents runtime [MISSING:xx] issues

- 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 3f63695 into main Dec 26, 2025
10 checks passed
@Gaubee
Gaubee deleted the feat/i18n-type-safety branch January 4, 2026 07:22
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.

1 participant