Skip to content

Conversation

@Gaubee
Copy link
Contributor

@Gaubee Gaubee commented Jan 21, 2026

Summary

Complete i18n migration for KeyApp - migrating hardcoded Chinese strings to the i18n system for multi-language support.

Changes

  • 109 → 2 Chinese literals (98% reduction)
  • Remaining 2 are error detection patterns with // i18n-ignore markers

Files Modified (20+)

Components

  • SigningConfirmJob.tsx, ChainSwitchConfirmJob.tsx - Remove defaultValue
  • MiniappTransferConfirmJob.tsx, MiniappDestroyConfirmJob.tsx - Remove all defaultValue
  • CryptoAuthorizeJob.tsx, WalletPickerJob.tsx - Remove all defaultValue
  • MigrationCompleteStep.tsx, MigrationProgressStep.tsx - Remove STEP_DEFAULTS + defaultValue
  • migration-required-view.tsx, WelcomeScreen.tsx - Remove defaultValue
  • chain-selector.tsx - Use translation function for chain kinds
  • crypto-authorize.tsx - Remove all defaultValue
  • SettingsSourcesActivity.tsx - Add translation keys and migrate

Pages

  • send/index.tsx, destroy/index.tsx - Remove defaultValue
  • authorize/signature.tsx - Convert to English + i18n-ignore
  • asset-selector.tsx, token-item.tsx - Remove defaultValue

Translation Keys Added

  • common:crypto.authorize.* (title, permissions, duration, address, pattern, error)
  • common:chainKind.* (bioforest, evm, bitcoin, tron, custom)
  • common:sources.* (title, noSources, urlPlaceholder, etc.)
  • error:signature.* (missingField, unsupportedType, etc.)

Remaining Chinese Literals (2)

These are error detection patterns, not UI text:

// src/hooks/use-send.bioforest.ts:325
if (errorMessage.includes('fee') || errorMessage.includes('手续费')) { // i18n-ignore

// src/hooks/use-send.web3.ts:143
if (errorMessage.includes('fee') || errorMessage.includes('手续费') || ... // i18n-ignore

Verification

  • pnpm typecheck passes (14/14 packages)
  • bun scripts/i18n-check.ts shows only 2 remaining (with i18n-ignore)
  • ✅ All translation keys added to 4 locales (zh-CN, zh-TW, en, ar)

Gaubee added 13 commits January 21, 2026 10:50
… i18n system

- Add i18n translations for crypto errors (decrypt, key derivation, biometric)
- Add i18n translations for chain errors (unsupported type, miniapp launch)
- Add i18n translations for transaction errors (gas, retry, validation)
- Migrate mpay-crypto, mpay-transformer, miniapp-runtime, pending-tx
- Migrate derivation.ts, encryption.ts, secure-storage.ts
- Migrate use-send.ts, use-send.web3.ts, use-multi-chain-address-generation.ts
- Migrate use-security-password.ts
- Add i18n-ignore markers for standalone clear page (cannot use React i18n)
- Add i18n-ignore markers for native language names (zh-CN, zh-TW, ja)
- Add i18n-ignore markers for config data in ecosystem store
- Migrate miniapp sources label in settings
- Migrate destroy page error messages
…e strings

- Add markers for swipeable-tabs, password-input, ecosystem-tab-indicator
- Add markers for transaction-list, token-list default props
- Add common translations for password strength, ecosystem tabs, etc.
- MiniappTransferConfirmJob: remove defaultValue
- MiniappDestroyConfirmJob: remove defaultValue
- CryptoAuthorizeJob: remove defaultValue
- WalletPickerJob: remove defaultValue
- SettingsSourcesActivity: add sources.* translation keys
- Add common keys: transferWarning, confirming, drawPatternToConfirm, selectWallet, noWallets, sources.*, refresh, enable, disable, etc.
- Regenerate i18n types
- send/index.tsx: remove assetLabel defaultValue
- destroy/index.tsx: remove all defaultValue (6 occurrences)
- asset-selector.tsx: remove defaultValue, add assetSelector.* keys
- token-item.tsx: remove a11y.more defaultValue
- SettingsSourcesActivity.tsx: fix remaining aria-labels
- Regenerate i18n types

Remaining: 56 Chinese literals (down from 109)
- authorize/signature.tsx: convert to English + i18n-ignore
- chain-selector.tsx: use translation function for chain kinds
- MigrationCompleteStep.tsx: remove all defaultValue
- MigrationProgressStep.tsx: remove STEP_DEFAULTS + defaultValue
- migration-required-view.tsx: remove all defaultValue
- WelcomeScreen.tsx: remove defaultValue
- crypto-authorize.tsx: remove all defaultValue
- Add crypto.authorize.* translation keys
- Add chainKind.* translation keys
- Add error:signature.* translation keys
- Regenerate i18n types

Final: 2 Chinese literals remaining (i18n-ignore for error detection)
@Gaubee Gaubee force-pushed the feat/i18n-migration-continue branch from 4259db0 to c8b8378 Compare January 21, 2026 02:50
@Gaubee Gaubee merged commit aad87b8 into main Jan 21, 2026
5 checks passed
@Gaubee Gaubee deleted the feat/i18n-migration-continue branch January 21, 2026 02:52
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