Skip to content

feat(i18n): achieve 100% English translation coverage and modernize default window dimensions - #201

Open
johngbl wants to merge 1 commit into
router-for-me:mainfrom
johngbl:feat/complete-english-translation
Open

feat(i18n): achieve 100% English translation coverage and modernize default window dimensions#201
johngbl wants to merge 1 commit into
router-for-me:mainfrom
johngbl:feat/complete-english-translation

Conversation

@johngbl

@johngbl johngbl commented Sep 2, 2026

Copy link
Copy Markdown

Summary

This pull request completes 100% English translation across the application UI, backend error messages, and dictionaries, while also improving desktop presentation by setting a modern default window size.

Key Changes

  1. Easy Mode Localization (src/pages/EasyModePage.tsx):

    • Localized all hardcoded Chinese strings into semantic i18n keys (t(...)), covering:
      • Topbar brand subtitle, beginner mode badge, guide toggle button, theme/language tooltips, and exit button.
      • Connection method cards (OAuth and API), supported provider descriptions, and status pills.
      • Interactive 4-step guided walkthrough (headers, step descriptions, dynamic guidance tips, and navigation buttons).
      • Form placeholders, error messages, and save notifications.
    • Cleaned up internal comments and default provider descriptors to English.
  2. OpenAI Compatibility Label (src/pages/ApiAccessPage.tsx):

    • Replaced hardcoded 'OpenAI 兼容' with dynamic localization (OpenAI Compatible in English, OpenAI 互換 in Japanese, OpenAI 相容 in Traditional Chinese, and OpenAI 兼容 in Simplified Chinese).
  3. Usage Records Localization (src/pages/UsageRecordsPage.tsx & src-tauri/src/usage.rs):

    • Localized unrecorded API key fallback (未记录密钥 -> Unrecorded Key), unknown source (未知来源 -> Unknown Source), and unknown provider (未知 Provider -> Unknown Provider) both dynamically in the UI and in backend analysis queries.
  4. Dictionary Alignment & Missing Keys (src/i18n/):

    • Added all new semantic keys across en.ts, zh-CN.ts, and ja.ts.
    • Fixed 41 missing keys in jaOverrides (src/i18n/ja.ts) that were causing dictionary structure tests to fail.
    • Preserved Traditional Chinese automatic conversion via traditional.ts.
  5. Version Management & Backend Errors (VersionManagementPage.tsx, app_update.rs, core_runtime.rs):

    • Added regex detection for English cancellation messages (/cancel/i).
    • Translated backend update failure and core check error messages to English.
    • Configured official GitCode repository fallback for development builds.
  6. Modern Desktop Window Dimensions (src-tauri/tauri.conf.json, src-tauri/src/main.rs):

    • Modernized the default window size from 1280x800 to 1400x860 for a more spacious, elegant layout on modern 1080p/2K/4K and 16:10 displays.
  7. Automated Verification:

    • Added a test in tests/i18n.test.ts validating 100% English coverage (0 Chinese characters in en.ts) and asserting key translations.

Verification

  • TypeScript / Bun Tests: 140 passed, 0 failed across 20 test files (bun test).
  • Rust / Cargo Tests: 308 passed, 0 failed (cargo test).
  • Type Checking: tsc --noEmit passed with 0 errors.
  • Production Build: vite build completed successfully.

…efault window dimensions

- Localize all hardcoded strings in EasyModePage (brand, buttons, tooltips, choice cards, forms, and interactive walkthrough)
- Localize OpenAI Compatibility label in ApiAccessPage
- Localize unrecorded key, unknown source, and unknown provider labels in UsageRecordsPage and usage service
- Synchronize all dictionaries (en, zh-CN, ja) and fix 41 missing keys in jaOverrides
- Support English cancellation message detection in VersionManagementPage
- Translate internal frontend error logs and backend update/core check errors to English
- Add default GitCode repository fallback for development builds
- Modernize default desktop window size from 1280x800 to 1400x860
- Add behavioral test asserting 100% English coverage across all keys in en
@lzt404

lzt404 commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Thanks for your work.

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