You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
改动
src/webapp/i18n.py:resolve_language(Accept-Language)(en*→en,其余/缺省→zh)+localize(message, code, language),按稳定错误码查英文词典,词典缺键回落泛化英文,保证英文模式不下发 CJK。src/webapp/handlers.py:所有异常处理器统一走_localized(request, ...);HTTP 状态码与error.code不变,仅error.message随语言变化。上游正文与用户自定义名称不经此路径,保持原文。web/src/i18n/index.tsx导出acceptLanguageHeader(),web/src/api/client.ts所有请求统一带Accept-Language(随界面语言切换)。验证
uv run ruff check src tests scriptsuv run pytest -q --cov=src --cov-report=term --cov-fail-under=100(6593 passed,覆盖率 100%)cd web && pnpm exec tsc --noEmit && pnpm exec vitest run && pnpm build