Skip to content

Internationalization#2557

Closed
nmnmcc wants to merge 10 commits into
cinnyapp:devfrom
nmnmcc:i18n
Closed

Internationalization#2557
nmnmcc wants to merge 10 commits into
cinnyapp:devfrom
nmnmcc:i18n

Conversation

@nmnmcc
Copy link
Copy Markdown

@nmnmcc nmnmcc commented Dec 25, 2025

This PR introduces a new internationalization system based on the intee library. It replaces the previous locale-based approach with a more robust, type-safe, and lazy-loading architecture. This migration covers English and Chinese (Simplified) translations across the entire application.

Key Changes

  • New i18n Core: Integrated @intee/core and @intee/react to manage translations.
  • Type-Safe Translations: All translations are now defined as TypeScript objects. This ensures compile-time checks for translation keys and provides strict type safety for dynamic content (interpolation) via functions instead of string placeholders.
  • Lazy Loading: Translation resources for non-default languages (e.g., zh-CN) are loaded asynchronously using dynamic imports, optimizing the initial bundle size.
  • Global Integration: Implemented a global Provider and replaced previous i18n logic with the useTranslation hook across 80+ components and hooks.
  • Documentation: Added a comprehensive development guide in src/app/internationalization/README.md covering implementation patterns and best practices.
  • Dependency Updates: Added @intee/core, @intee/react.

Why this change?

  1. Developer Experience: TypeScript autocompletion for translation keys significantly reduces "missing key" errors and improves development speed.
  2. Reliability: Function-based interpolation ensures that arguments for dynamic strings are type-checked at compile time.
  3. Performance: Lazy loading ensures users only download the translation files they actually need.
  4. Scalability: The new structure makes it much easier to add and maintain additional languages in the future.

Technical Details

  • Fallback Language: English (en) serves as the source of truth for all translation types.
  • Locale Matching: Uses a scoring system (mean, startsWith) to accurately match the user's browser language with available tags.
  • State Management: Language preferences are integrated with the existing application settings state.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Dec 25, 2025

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@nmnmcc
Copy link
Copy Markdown
Author

nmnmcc commented Dec 25, 2025

I have read the CLA Document and I hereby sign the CLA

ajbura added a commit to cinnyapp/cla that referenced this pull request Dec 25, 2025
@nmnmcc
Copy link
Copy Markdown
Author

nmnmcc commented Dec 25, 2025

I'm still learning English. This description was written by AI, so please don't worry too much about any potentially inappropriate expressions.

Despite my efforts using AI and my own methods to find all the hard-coded text, many still slipped through the net.

@nmnmcc
Copy link
Copy Markdown
Author

nmnmcc commented Dec 25, 2025

I also switched the package manager to Yarn Berry, simply because npm is too slow on my computer in my country. If you object, I'll switch back.

@nmnmcc nmnmcc marked this pull request as ready for review December 25, 2025 16:10
@cinnyapp cinnyapp deleted a comment from Geequlim Feb 18, 2026
@kfiven
Copy link
Copy Markdown
Member

kfiven commented Feb 23, 2026

We do not plan to change i18n, so this is out of scope. Closing..

@kfiven kfiven closed this Feb 23, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Feb 23, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants