Skip to content

feat: Chinese (zh-CN) localization for frontend#69

Closed
SummerSec wants to merge 1 commit into
debpalash:mainfrom
SummerSec:main
Closed

feat: Chinese (zh-CN) localization for frontend#69
SummerSec wants to merge 1 commit into
debpalash:mainfrom
SummerSec:main

Conversation

@SummerSec
Copy link
Copy Markdown

@SummerSec SummerSec commented May 16, 2026

Summary

Comprehensive Chinese (zh-CN) localization across the frontend, plus bug fixes.

Translated pages

  • NavRail, Launchpad, Clone/Design tabs, Settings (all 8 tabs)
  • Transcriptions, Voice Gallery, DubTab (upload area)

Bug fixes

  • Settings General tab was missing from TABS array
  • Language preference reset on page reload (useEffect deps fix)
  • Personality presets with natural language descriptions no longer cause backend validation errors (instruct filtering)
  • NavRail React key prop warning

SummerSec

Summary by CodeRabbit

Release Notes

  • New Features

    • Added Chinese language support to the app
    • Users can now select their preferred language in settings
  • Improvements

    • Internationalized UI strings across app components
    • Enhanced voice personality presets with backend validation
    • Optimized model compilation for improved compatibility

Review Change Stack

* @
fix: skip torch.compile on Windows where Triton is unavailable

torch.compile with mode="reduce-overhead" depends on Triton, which has no
official Windows support. On Windows the compile call succeeds but generates
code paths that crash at inference time with an OOM-like error
("Cannot find a working triton installation").

Check for Triton availability before compiling so TTS gracefully falls back
to eager mode on platforms without Triton.

Closes debpalash#65
SummerSec
@

* feat: comprehensive Chinese (zh-CN) localization for Settings and navigation

Add full Chinese (zh-CN) translation support across the frontend:
- NavRail, Launchpad, Clone/Design tabs, Settings (all tabs)
- Sidebar navigation labels, hero text, action cards, section headings
- Fix: Settings missing General tab in TABS array
- Fix: i18n locale not persisted after page reload (useEffect deps)
- Fix: NavRail key prop spreading into JSX elements

Co-authored-by: SummerSec

* fix: translate production override parameter labels (Speed, t_shift, etc.)

* fix: translate voice design category labels (Gender, Age, Pitch, etc.)

* feat: translate Transcriptions and Voice Gallery pages

* fix: translate gallery category names (Disney, Anime, etc.)

* feat: translate DubTab, personality presets, and voice design presets

* fix: remove duplicated emoji in personality name translations

* fix: correct preset translation keys to match actual preset IDs

* fix: filter natural language from personality instruct to prevent validation error

* fix: handle edge case where instruct has no valid tags

* chore: remove debug logging from personality instruct filter
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 16, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 1d80edd7-0168-49c5-94a7-f0a98ed62db7

📥 Commits

Reviewing files that changed from the base of the PR and between ba4cf6a and aaa588d.

📒 Files selected for processing (13)
  • backend/services/model_manager.py
  • frontend/src/App.jsx
  • frontend/src/components/Header.jsx
  • frontend/src/components/NavRail.jsx
  • frontend/src/i18n/locales/en.json
  • frontend/src/i18n/locales/zh-CN.json
  • frontend/src/pages/CloneDesignTab.jsx
  • frontend/src/pages/DubTab.jsx
  • frontend/src/pages/Launchpad.jsx
  • frontend/src/pages/Settings.jsx
  • frontend/src/pages/Transcriptions.jsx
  • frontend/src/pages/VoiceGallery.jsx
  • frontend/src/utils/constants.js

📝 Walkthrough

Walkthrough

This PR implements comprehensive internationalization (i18n) across the frontend application with support for English and Chinese locales. It adds locale-aware theme hydration at the app root, introduces a new Settings GeneralTab for language/theme configuration, and optimizes backend model compilation to conditionally apply torch.compile based on triton availability. All user-facing strings have been replaced with translation keys across ten frontend pages plus components.

Changes

Internationalization & Localization

Layer / File(s) Summary
Backend model compilation optimization
backend/services/model_manager.py
_load_model_sync() checks triton module availability before applying torch.compile, logging a skip when triton is absent and proceeding with compilation when available.
App-level i18n foundation and locale hydration
frontend/src/App.jsx
Imports i18n module and establishes a useEffect that hydrates both theme (data-theme attribute) and locale (via i18n.changeLanguage) from Zustand store whenever either changes, replacing the prior mount-only theme-only effect.
English and Chinese translation resources
frontend/src/i18n/locales/en.json, frontend/src/i18n/locales/zh-CN.json
Complete English locale catalog covering common UI actions, navigation, launchpad/clone features, settings/about/privacy sections, dubbing/transcription/gallery workflows, and new feature areas; parallel Chinese (zh-CN) translations for all sections including templates and placeholders.
Instruct item validation constant
frontend/src/utils/constants.js
Introduces VALID_INSTRUCT_ITEMS allowlist for backend-recognized personality tags, used downstream to filter preset instructions before application.
Navigation component localization
frontend/src/components/Header.jsx, frontend/src/components/NavRail.jsx
Header reload button and NavRail navigation items now use translation keys; NavRail refactored to build dynamic localized items from ITEM_DEFS via useTranslation and useMemo instead of static arrays.
Settings infrastructure and GeneralTab
frontend/src/pages/Settings.jsx
Introduces TAB_DEFS for localized tab labels, adds GeneralTab for locale/theme selection via Select UI, defines LOG_SOURCE_DEFS with translation keys, and wires useTranslation at page level. Models, Engines, Logs, About, Privacy, Capture, and Credentials tabs all localized: loading states, column headers, options, badges, button labels, descriptions, help text, and toast messages now use translation keys.
Launchpad page localization
frontend/src/pages/Launchpad.jsx
Hero section (title/description via Trans), demo callout button, project section titles (Cloned/Designed/Dubbing Voices/Projects), action buttons (Open), and status badges (Locked/Audio-only) now use translation keys.
Clone/Design tab localization and validation
frontend/src/pages/CloneDesignTab.jsx
Integrates VALID_INSTRUCT_ITEMS validation into personality preset application (filters instruct string to only backend-recognized tags). All UI: sidebar toggle, preset buttons, language/steps labels, voice source/profile headings, category sliders with option chips, production overrides, save-as-profile controls, and microphone recording states localized via translation keys.
Dub tab localization
frontend/src/pages/DubTab.jsx
Filename fallback, Save/Reset buttons, drop-zone title, ingest URL placeholder, ingest button, and pull-captions checkbox labels now use translation keys.
Transcriptions page localization
frontend/src/pages/Transcriptions.jsx
Page title, entry count label, search placeholder/ARIA labels, empty-state messages (search-specific vs. default), copy/delete action buttons, export/clear controls, and segments panel header localized. Clipboard copy and export handlers use localized toast success/error messages.
Voice Gallery page localization
frontend/src/pages/VoiceGallery.jsx
Page title, search placeholder, category chip labels (per-category translation keys with fallback), YouTube results count, download button, view-mode tooltips (List/Grid), empty-state messages, play/pause button tooltips, and action button tooltips (clone profile, crop audio, delete) all use translation keys.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

The PR is large and spans many files with heterogeneous changes—each page component and the Settings module require individual review of localization logic and translation key mappings. While most changes follow a consistent pattern (useTranslation + t() calls), the Settings page contains significant structural changes (TAB_DEFS, GeneralTab, CREDENTIAL_DEFS) and the Clone/Design tab adds validation logic alongside localization. The backend change is minimal and straightforward.

Possibly related PRs

  • debpalash/OmniVoice-Studio#37: Modifies _load_model_sync() loading status behavior in the same backend model-loading path that this PR optimizes with conditional torch.compile.

Poem

🐰 Whiskers twitch with translation glee,
As English dances, Chinese flows so free,
Settings bloom with locale's gentle hand,
While torch now checks for triton in the sand—
A multilingual meadow, oh so grand!

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@SummerSec
Copy link
Copy Markdown
Author

Replaced by PR #66 which has properly separated commits

@SummerSec SummerSec closed this May 16, 2026
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