[Feature] macOS/iOS 麦克风系统权限用途说明未按系统语言本地化
- Dominant language
- TypeScript
- Stars
- 2.7k
- Forks
- 395
- Avg merge
- 21h 48m
- Merged PRs (30d)
- 776
Description
## 问题描述
macOS Desktop 和 iOS Mobile 的麦克风系统权限用途说明目前固定为英文。当设备首选语言为简体中文、日语或韩语时,Cindy 应用内界面可以显示对应语言,但首次申请麦克风权限时,系统授权弹窗仍显示英文,造成语言体验不一致。
关联缺陷:`BUG-016`
关联用例:`TC-06-07`、`TC-5`、首次申请麦克风权限
## 当前实现
### Desktop macOS
`apps/desktop/forge.config.ts` 为主应用和 Electron Helper 固定写入英文用途说明:
```ts
NSMicrophoneUsageDescription:
'This app needs access to the microphone for voice input.'
```
仓库当前没有对应的 `*.lproj/InfoPlist.strings`,macOS 无法按设备首选语言选择本地化用途说明。
### Mobile iOS
`apps/mobile/app.json` 中 `expo-audio` 的用途说明固定为英文:
```json
[
"expo-audio",
{
"microphonePermission": "Cindy needs microphone access for voice input in remote sessions.",
"recordAudioAndroid": true
}
]
```
该配置会生成 iOS 的 `NSMicrophoneUsageDescription`,但当前没有按语言提供的 iOS `InfoPlist.strings`。
## 实际结果
macOS 和 iOS 的系统麦克风权限用途说明固定显示英文,不随设备系统语言切换。应用内 i18n 资源不会被系统权限弹窗读取。
## 期望结果
- 英文系统显示英文用途说明。
- 简体中文系统显示简体中文用途说明。
- 日文系统显示日文用途说明。
- 韩文系统显示韩文用途说明。
- 不支持的系统语言回退到英文。
- macOS 主应用及实际参与录音的 Helper 均包含正确的本地化资源。
- iOS 原生工程和最终安装包包含正确的本地化资源。
- Windows、Linux、Android 继续使用操作系统本地化的标准权限弹窗,现有行为不回归。
- Android 当前原生录音模块阻塞,解除阻塞后补包验收。
## 技术边界
- macOS/iOS 系统权限弹窗读取原生 `Info.plist` / `InfoPlist.strings`,不能直接复用 renderer 的 i18next 资源。
- 系统弹窗按设备系统首选语言选择文案,不保证与应用内手动选择的语言完全一致。
- Android、Windows 和 Linux 的标准系统权限 UI 由操作系统、桌面环境或 Chromium 本地化;应用自己的权限解释 UI 仍需使用应用 i18n。
- 本修改涉及原生包资源,不能通过 Desktop renderer 热更新或 Mobile OTA 修复,需要重新构建原生安装包。
## 建议实现
### Desktop macOS
1. 保留 `Info.plist` 中的英文说明作为 fallback。
2. 增加 `en`、`zh-Hans`、`ja`、`ko` 对应的 `InfoPlist.strings`。
3. 在 Electron Forge 打包阶段确保资源进入主应用和相关 Helper bundle。
4. 检查签名后的最终 `.app`,不能只验证源码目录。
### Mobile iOS
1. 保留 `expo-audio.microphonePermission` 的英文值作为 fallback。
2. 通过 Expo 原生本地化配置或 config plugin 生成各语言 `InfoPlist.strings`。
3. 确保资源加入 iOS target 并进入最终 `.app` / IPA。
4. 增加 resolved config 或 prebuild 产物测试。
5. 按原生 fingerprint 变更处理,走冷更发布。
## 建议文案
- English:`Cindy needs access to the microphone for voice input.`
- 简体中文:`Cindy 需要访问麦克风,以便使用语音输入。`
- 日本語:`Cindyで音声入力を使用するために、マイクへのアクセスが必要です。`
- 한국어:`Cindy에서 음성 입력을 사용하려면 마이크 접근 권한이 필요합니다.`
具体文案合入前需由产品或对应语言使用者校对。如果 Mobile 必须强调“远程会话”,四种语言应统一包含这一语义。
## 验收标准
- [ ] Desktop 最终产物包含四种语言的 `InfoPlist.strings`。
- [ ] Desktop 主应用和相关 Helper 均包含 `NSMicrophoneUsageDescription`。
- [ ] Mobile 生成的 iOS 工程及最终 IPA 包含四种语言的用途说明。
- [ ] macOS 和 iOS 分别在英语、简体中文、日语、韩语系统上完成首次授权真机验收。
- [ ] 拒绝、重新授权和语音录音行为无回归。
- [ ] Windows/Linux 现有权限提示和语音输入行为无回归。
- [ ] Android 原生录音模块解除阻塞后完成补包验收。
## 关联 issue
- Windows 麦克风权限状态、请求守卫和系统设置入口:#21
- 语音输入快捷键注册:#22
- 语音数据持久化:#25
旧仓 `(旧版内部仓库)` 中暂未找到与本问题直接对应的 issue。
Contributor guide
Research direction
Start by reading apps/desktop/forge.config.ts and apps/mobile/app.json, then inspect the Electron Forge packaging and Expo prebuild configuration. Verify the generated macOS app, helper bundles, iOS project, and final IPA contain the four localized InfoPlist.strings resources. Done means the listed language and fallback checks pass without regressions on other platforms.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- electron, ios, macos, react-native, typescript
- Domain
- build-system, desktop, localization, mobile
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100