refactor(settings): 统一语言设置,合并 interface_language 和 ai_language

- 后端 Schema 将 interface_language 和 ai_language 合并为 language
- 前端设置界面只保留一个语言选项
- AI 回复语言统一使用 language 设置
- 更新协议文档
- 新增数据库迁移脚本
This commit is contained in:
ZL-Q
2026-04-28 17:19:47 +08:00
parent 940c67e642
commit b9617ae152
20 changed files with 740 additions and 176 deletions
@@ -13,28 +13,20 @@ String displayLanguageLabel(AppLocalizations l10n, String languageTag) {
class PreferenceSettings {
const PreferenceSettings({
this.interfaceLanguage = 'zh-CN',
this.aiLanguage = 'zh-CN',
this.language = 'zh-CN',
this.timezone = 'Asia/Shanghai',
this.country = 'US',
});
final String interfaceLanguage;
final String aiLanguage;
final String language;
final String timezone;
final String country;
PreferenceSettings copyWith({
String? interfaceLanguage,
String? aiLanguage,
String? language,
String? timezone,
String? country,
}) {
return PreferenceSettings(
interfaceLanguage: interfaceLanguage ?? this.interfaceLanguage,
aiLanguage: aiLanguage ?? this.aiLanguage,
language: language ?? this.language,
timezone: timezone ?? this.timezone,
country: country ?? this.country,
);
}
}
@@ -151,7 +143,7 @@ class ProfileSettingsV1 {
factory ProfileSettingsV1.defaultsForLocale(Locale locale) {
final tag = languageTagFromLocale(locale);
return ProfileSettingsV1(
preferences: PreferenceSettings(interfaceLanguage: tag, aiLanguage: tag),
preferences: PreferenceSettings(language: tag),
);
}
}