simprint icon indicating copy to clipboard operation
simprint copied to clipboard

[Bug]: IP 匹配模式下浏览器语言仍回退为中文

Open Luxciax opened this issue 3 months ago • 0 comments

Area

Frontend / UI

Version or commit

No response

Environment

Local development build

Operating system

Windows 11

Reproduction steps

  1. 配置一个非中国代理,例如 US 或 GB 代理。
  2. 确认代理 IP 检测结果为对应国家。
  3. 创建新环境,将“语言”和“界面语言”设置为“基于 IP 匹配”。
  4. 启动环境。
  5. 检查浏览器语言或使用浏览器指纹检测页面验证。

Expected behavior

浏览器语言应根据代理 IP 国家匹配,例如:

  • US → en-US
  • GB → en-GB
  • JP → ja-JP
  • FR → fr-FR

Actual behavior

浏览器语言仍显示为中文,或没有被替换,可能最终回退到 zh-CN。

Logs, screenshots, or additional context

## 源码线索

当前代码中存在以下问题:

1. `plugins/pages/create-window/src/utils/resolve-fingerprint-config.ts` 实现了 IP 语言解析,但全仓库没有调用点。
2. Rust 启动逻辑只解析 `language`,没有解析 `interface_language`。
3. 代理 IP 检测失败时会回退到本机直连 IP,可能导致中国本机被识别为 `zh-CN`。
4. 检测失败后可能继续把 `"ip"` 原值传递给浏览器内核。

相关代码:

- `src-tauri/src/services/environment/kernel/runtime_bridge.rs`
- `src-tauri/src/services/environment/kernel/language.rs`
- `src-tauri/src/services/environment/launch_runtime/fingerprint.rs`
- `plugins/pages/create-window/src/utils/resolve-fingerprint-config.ts`

## 建议

- 在实际启动链路中统一解析 `language` 和 `interface_language`。
- 代理检测失败时不要静默回退到本机 IP。
- 检测失败时明确报错或使用可控的安全默认值。
- 增加 US、GB、JP、FR 等非中文代理的语言匹配测试。

Before submitting

  • [x] I searched existing issues and did not find an obvious duplicate.
  • [x] I included enough detail for someone else to try reproducing the problem.

Luxciax avatar Aug 23 '26 12:08 Luxciax