Skip to content

feat(i18n): add English/Chinese language toggle with full UI translation#400

Closed
koyouko wants to merge 2 commits into666ghj:mainfrom
koyouko:claude/confident-shtern
Closed

feat(i18n): add English/Chinese language toggle with full UI translation#400
koyouko wants to merge 2 commits into666ghj:mainfrom
koyouko:claude/confident-shtern

Conversation

@koyouko
Copy link
Copy Markdown

@koyouko koyouko commented Mar 30, 2026

Summary

This PR combines two major improvements:

  1. Multi-provider LLM support — backend now supports 5 providers (Anthropic/Claude, OpenAI, GitHub Copilot, Ollama, MiniMax/GLM)
  2. Full English/Chinese i18n — frontend defaults to English with a live language toggle

1. Multi-Provider LLM Backend

New Files

File Purpose
backend/app/utils/copilot_auth.py GitHub Copilot OAuth token exchange (from upstream PR #383)

Modified Files

File Changes
backend/app/utils/llm_client.py Unified 5-provider client with estimate_tokens() and chat_with_tools()
backend/app/config.py All provider configs + English comments
backend/app/services/simulation_runner.py Thread-safety fixes (from upstream PR #389)
backend/app/services/oasis_profile_generator.py Updated to use unified client
backend/app/services/simulation_config_generator.py Updated to use unified client
backend/app/__init__.py Translated to English
backend/app/api/__init__.py Translated to English
.env.example All provider env vars documented
backend/requirements.txt / pyproject.toml Updated dependencies

Supported Providers

LLM_PROVIDER=anthropic   # Claude (claude-opus-4-5, claude-sonnet-4-5, etc.)
LLM_PROVIDER=openai      # OpenAI (gpt-4o, gpt-4-turbo, etc.)
LLM_PROVIDER=copilot     # GitHub Copilot (OAuth token)
LLM_PROVIDER=ollama      # Local Ollama (llama3, mistral, etc.)
LLM_PROVIDER=minimax     # MiniMax/GLM (original default)

2. Frontend i18n (English/Chinese Toggle)

New Files

File Purpose
frontend/src/store/locale.js Reactive locale singleton backed by localStorage
frontend/src/i18n/index.js Full en + zh translation dictionaries
frontend/src/i18n/useT.js useT() composable — computed key-resolver, auto re-renders on locale change

All 15 Vue files translated

Views: Home.vue, MainView.vue, SimulationView.vue, SimulationRunView.vue, ReportView.vue, InteractionView.vue, Process.vue

Step components: Step1GraphBuild.vue, Step2EnvSetup.vue, Step3Simulation.vue, Step4Report.vue, Step5Interaction.vue

Other: GraphPanel.vue, HistoryDatabase.vue


Test Plan

  • English shown by default on page load
  • EN/中 toggle switches entire UI instantly, persists to localStorage
  • Production build passes (vite build — 679 modules, no errors)
  • LLM_PROVIDER=anthropic routes to Claude API correctly
  • Thread-safe simulation runner (no race conditions on concurrent requests)

Implements a lightweight reactive i18n system without external libraries.
English is now the default language; users can switch to Chinese via the
EN/中 toggle button in the navbar, with preference persisted to localStorage.

Co-Authored-By: koyouko <koyouko@users.noreply.github.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. enhancement New feature or request labels Mar 30, 2026
… Copilot)

Replaces the single-provider LLM client with a unified 5-provider client.
Adds thread-safety improvements to simulation_runner from upstream PR 666ghj#389,
GitHub Copilot OAuth token support from upstream PR 666ghj#383, and translates
all backend Python modules to English.

Providers supported: Anthropic (Claude), OpenAI, GitHub Copilot (OAuth),
Ollama (local), and the original MiniMax/GLM default.

Co-Authored-By: koyouko <koyouko@users.noreply.github.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@666ghj
Copy link
Copy Markdown
Owner

666ghj commented Apr 2, 2026

The project already has i18n support in place — please refer to [PR #428] for reference.

@666ghj 666ghj closed this Apr 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants