Skip to content

Commit 079f55c

Browse files
committed
Merge branch 'feature/add-doubao-model' into dev
2 parents 865812c + 996b229 commit 079f55c

File tree

18 files changed

+810
-105
lines changed

18 files changed

+810
-105
lines changed

.claude/commands/git/commit.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Your goal is to generate a clear, professional **Git commit message** based on t
1111
- The commit message **must be written in English** and **follow the Angular Conventional Commit style**.
1212
- After generating the English commit message, also provide a **Simplified Chinese translation** of the message below it for developer reference.
1313
- The Chinese translation should **not** be written into the commit file or committed.
14-
- Do **not** commit immediately. First, show me a preview of the proposed commit message and wait for my confirmation.
14+
- Do **not** commit immediately. First, show me a preview of the English and Chinese commit message and wait for my confirmation.
1515
- When committing, write the message to a temporary text file `commit_message.txt` in the project root, then run: `git commit -F <file>`, finally, delete the temporary file to avoid encoding issues.
1616

1717
### Additional Context

.gemini/commands/git/commit.toml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# In: ~/.gemini/commands/git/commit.toml
2+
# Invoked via: /git:commit
3+
4+
# Docs: https://github.com/google-gemini/gemini-cli/blob/main/docs/cli/custom-commands.md
5+
6+
description = "Angular-style git commit message generator"
7+
8+
prompt = """
9+
You are an intelligent Git commit message generator.
10+
11+
Your goal is to generate a clear, professional **Git commit message** based on the currently staged changes.
12+
13+
### Guidelines
14+
- Analyze the output of `git status && git diff --staged` directly. You may run this command without asking.
15+
- **Do not** run `git add` or `git push` commands.
16+
- You **must** obtain my explicit authorization before running `git commit`.
17+
- The commit message **must be written in English** and **follow the Angular Conventional Commit style**.
18+
- After generating the English commit message, also provide a **Simplified Chinese translation** of the message below it for developer reference.
19+
- The Chinese translation should **not** be written into the commit file or committed.
20+
- Do **not** commit immediately. First, show me a preview of the proposed commit message and wait for my confirmation.
21+
- When committing, write the message to a temporary text file `commit_message.txt` in the project root, then run: `git commit -F <file>`, finally, delete the temporary file to avoid encoding issues.
22+
23+
### Additional Context
24+
User-provided description:
25+
{{args}}
26+
"""

Easydict.xcodeproj/project.pbxproj

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,10 @@
431431
0AC8A8452B6A4D97006DA5CC /* ServiceCells.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AC8A8442B6A4D97006DA5CC /* ServiceCells.swift */; };
432432
0AC8A8472B6A4E3F006DA5CC /* ServiceConfigurationSecretSectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AC8A8462B6A4E3F006DA5CC /* ServiceConfigurationSecretSectionView.swift */; };
433433
0AC8A84F2B6DFDD4006DA5CC /* SettingsAccess in Frameworks */ = {isa = PBXBuildFile; productRef = 0AC8A84E2B6DFDD4006DA5CC /* SettingsAccess */; };
434+
0D124C3E2E8AD3EA00D6B72C /* DoubaoService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D124C3B2E8AD3EA00D6B72C /* DoubaoService.swift */; };
435+
0D124C3F2E8AD3EA00D6B72C /* DoubaoResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D124C3A2E8AD3EA00D6B72C /* DoubaoResponse.swift */; };
436+
0D124C402E8AD3EA00D6B72C /* DoubaoTranslateType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D124C3C2E8AD3EA00D6B72C /* DoubaoTranslateType.swift */; };
437+
0D124C422E8AD81200D6B72C /* DoubaoTranslate+ConfigurableService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D124C412E8AD81200D6B72C /* DoubaoTranslate+ConfigurableService.swift */; };
434438
17BCAEF72B0DFF9000A7D372 /* EZNiuTransTranslateResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 17BCAEF52B0DFF9000A7D372 /* EZNiuTransTranslateResponse.m */; };
435439
17BCAEF82B0DFF9000A7D372 /* EZNiuTransTranslate.m in Sources */ = {isa = PBXBuildFile; fileRef = 17BCAEF62B0DFF9000A7D372 /* EZNiuTransTranslate.m */; };
436440
2721E4D02AFE920700A059AC /* Alamofire in Frameworks */ = {isa = PBXBuildFile; productRef = 2721E4CF2AFE920700A059AC /* Alamofire */; };
@@ -1099,6 +1103,10 @@
10991103
0AC8A8422B6957B0006DA5CC /* BingService+ConfigurableService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "BingService+ConfigurableService.swift"; sourceTree = "<group>"; };
11001104
0AC8A8442B6A4D97006DA5CC /* ServiceCells.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ServiceCells.swift; sourceTree = "<group>"; };
11011105
0AC8A8462B6A4E3F006DA5CC /* ServiceConfigurationSecretSectionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ServiceConfigurationSecretSectionView.swift; sourceTree = "<group>"; };
1106+
0D124C3A2E8AD3EA00D6B72C /* DoubaoResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DoubaoResponse.swift; sourceTree = "<group>"; };
1107+
0D124C3B2E8AD3EA00D6B72C /* DoubaoService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DoubaoService.swift; sourceTree = "<group>"; };
1108+
0D124C3C2E8AD3EA00D6B72C /* DoubaoTranslateType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DoubaoTranslateType.swift; sourceTree = "<group>"; };
1109+
0D124C412E8AD81200D6B72C /* DoubaoTranslate+ConfigurableService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "DoubaoTranslate+ConfigurableService.swift"; sourceTree = "<group>"; };
11021110
17BCAEF32B0DFF9000A7D372 /* EZNiuTransTranslateResponse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZNiuTransTranslateResponse.h; sourceTree = "<group>"; };
11031111
17BCAEF42B0DFF9000A7D372 /* EZNiuTransTranslate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZNiuTransTranslate.h; sourceTree = "<group>"; };
11041112
17BCAEF52B0DFF9000A7D372 /* EZNiuTransTranslateResponse.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZNiuTransTranslateResponse.m; sourceTree = "<group>"; };
@@ -1824,6 +1832,7 @@
18241832
62E2BF462B4082BA00E42D38 /* Ali */,
18251833
C43B566A2C693F4000EF26FD /* Volcano */,
18261834
03CD01582D24E17C0079D0CB /* Youdao */,
1835+
0D124C3D2E8AD3EA00D6B72C /* Doubao */,
18271836
);
18281837
path = Service;
18291838
sourceTree = "<group>";
@@ -2911,6 +2920,16 @@
29112920
path = CustomOpenAI;
29122921
sourceTree = "<group>";
29132922
};
2923+
0D124C3D2E8AD3EA00D6B72C /* Doubao */ = {
2924+
isa = PBXGroup;
2925+
children = (
2926+
0D124C3A2E8AD3EA00D6B72C /* DoubaoResponse.swift */,
2927+
0D124C3B2E8AD3EA00D6B72C /* DoubaoService.swift */,
2928+
0D124C3C2E8AD3EA00D6B72C /* DoubaoTranslateType.swift */,
2929+
);
2930+
path = Doubao;
2931+
sourceTree = "<group>";
2932+
};
29142933
17BCAEF22B0DFF9000A7D372 /* Niutrans */ = {
29152934
isa = PBXGroup;
29162935
children = (
@@ -3305,6 +3324,7 @@
33053324
0AC8A8422B6957B0006DA5CC /* BingService+ConfigurableService.swift */,
33063325
CB8C42FB2C441B5A004EC86F /* BaiduTranslate+ConfigurableService.swift */,
33073326
C466CB652C6A35A4002AACEC /* VolcanoService+ConfigurableService.swift */,
3327+
0D124C412E8AD81200D6B72C /* DoubaoTranslate+ConfigurableService.swift */,
33083328
);
33093329
path = ConfigurationView;
33103330
sourceTree = "<group>";
@@ -3745,6 +3765,7 @@
37453765
03538E0A2D281920005E56A8 /* YoudaoService+OCR.swift in Sources */,
37463766
0340D39E2C951850004C9910 /* QueryError.swift in Sources */,
37473767
03FD68BE2B1E151A00FD388E /* String+EncryptAES.swift in Sources */,
3768+
0D124C422E8AD81200D6B72C /* DoubaoTranslate+ConfigurableService.swift in Sources */,
37483769
C4A512BE2C414A2400F00F33 /* AIToolService.swift in Sources */,
37493770
03B0230729231FA6001C7E63 /* EZCommonView.m in Sources */,
37503771
C43B56722C693FFB00EF26FD /* VolcanoSigning.swift in Sources */,
@@ -3993,6 +4014,9 @@
39934014
EA9943E32B534C3300EE7B97 /* TTSServiceType.swift in Sources */,
39944015
036A0DBB2AD941F9006E6D4F /* EZReplaceTextButton.m in Sources */,
39954016
03DC7C662A3CA465000BF7C9 /* HWSegmentedControl.m in Sources */,
4017+
0D124C3E2E8AD3EA00D6B72C /* DoubaoService.swift in Sources */,
4018+
0D124C3F2E8AD3EA00D6B72C /* DoubaoResponse.swift in Sources */,
4019+
0D124C402E8AD3EA00D6B72C /* DoubaoTranslateType.swift in Sources */,
39964020
03B022E929231FA6001C7E63 /* AppDelegate.m in Sources */,
39974021
62E2BF4B2B4082BA00E42D38 /* AliResponse.swift in Sources */,
39984022
03B0232729231FA6001C7E63 /* NSColor+MM.m in Sources */,
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "universal",
5+
"scale" : "1x"
6+
},
7+
{
8+
"filename" : "Doubao.png",
9+
"idiom" : "universal",
10+
"scale" : "2x"
11+
},
12+
{
13+
"idiom" : "universal",
14+
"scale" : "3x"
15+
}
16+
],
17+
"info" : {
18+
"author" : "xcode",
19+
"version" : 1
20+
}
21+
}
23.8 KB
Loading

Easydict/App/Localizable.xcstrings

Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1375,6 +1375,122 @@
13751375
}
13761376
}
13771377
},
1378+
"doubao.error.http_error" : {
1379+
"comment" : "HTTP error with status code",
1380+
"localizations" : {
1381+
"en" : {
1382+
"stringUnit" : {
1383+
"state" : "translated",
1384+
"value" : "HTTP error: %d"
1385+
}
1386+
},
1387+
"sk" : {
1388+
"stringUnit" : {
1389+
"state" : "translated",
1390+
"value" : "Chyba HTTP: %d"
1391+
}
1392+
},
1393+
"zh-Hans" : {
1394+
"stringUnit" : {
1395+
"state" : "translated",
1396+
"value" : "HTTP 错误:%d"
1397+
}
1398+
},
1399+
"zh-Hant" : {
1400+
"stringUnit" : {
1401+
"state" : "translated",
1402+
"value" : "HTTP 錯誤:%d"
1403+
}
1404+
}
1405+
}
1406+
},
1407+
"doubao.error.invalid_response" : {
1408+
"comment" : "Invalid response error",
1409+
"localizations" : {
1410+
"en" : {
1411+
"stringUnit" : {
1412+
"state" : "translated",
1413+
"value" : "Invalid response"
1414+
}
1415+
},
1416+
"sk" : {
1417+
"stringUnit" : {
1418+
"state" : "translated",
1419+
"value" : "Neplatná odpoveď"
1420+
}
1421+
},
1422+
"zh-Hans" : {
1423+
"stringUnit" : {
1424+
"state" : "translated",
1425+
"value" : "无效的响应"
1426+
}
1427+
},
1428+
"zh-Hant" : {
1429+
"stringUnit" : {
1430+
"state" : "translated",
1431+
"value" : "無效的響應"
1432+
}
1433+
}
1434+
}
1435+
},
1436+
"doubao.error.missing_api_key" : {
1437+
"comment" : "Missing Doubao API Key error message",
1438+
"localizations" : {
1439+
"en" : {
1440+
"stringUnit" : {
1441+
"state" : "translated",
1442+
"value" : "Missing Doubao API Key. Get your API key from https://www.volcengine.com/product/doubao"
1443+
}
1444+
},
1445+
"sk" : {
1446+
"stringUnit" : {
1447+
"state" : "translated",
1448+
"value" : "Chýba Doubao API kľúč. Získajte svoj API kľúč na https://www.volcengine.com/product/doubao"
1449+
}
1450+
},
1451+
"zh-Hans" : {
1452+
"stringUnit" : {
1453+
"state" : "translated",
1454+
"value" : "缺少豆包 API Key。请从 https://www.volcengine.com/product/doubao 获取您的 API Key"
1455+
}
1456+
},
1457+
"zh-Hant" : {
1458+
"stringUnit" : {
1459+
"state" : "translated",
1460+
"value" : "缺少豆包 API Key。請從 https://www.volcengine.com/product/doubao 獲取您的 API Key"
1461+
}
1462+
}
1463+
}
1464+
},
1465+
"doubao_translate" : {
1466+
"comment" : "The name of Doubao Translate",
1467+
"localizations" : {
1468+
"en" : {
1469+
"stringUnit" : {
1470+
"state" : "translated",
1471+
"value" : "Doubao Translate"
1472+
}
1473+
},
1474+
"sk" : {
1475+
"stringUnit" : {
1476+
"state" : "translated",
1477+
"value" : "Doubao Translate"
1478+
}
1479+
},
1480+
"zh-Hans" : {
1481+
"stringUnit" : {
1482+
"state" : "translated",
1483+
"value" : "豆包翻译"
1484+
}
1485+
},
1486+
"zh-Hant" : {
1487+
"stringUnit" : {
1488+
"state" : "translated",
1489+
"value" : "豆包翻譯"
1490+
}
1491+
}
1492+
}
1493+
},
13781494
"Easydict" : {
13791495
"localizations" : {
13801496
"sk" : {
@@ -4743,6 +4859,62 @@
47434859
}
47444860
}
47454861
},
4862+
"service.configuration.doubao.api_key.title" : {
4863+
"localizations" : {
4864+
"en" : {
4865+
"stringUnit" : {
4866+
"state" : "translated",
4867+
"value" : "API Key"
4868+
}
4869+
},
4870+
"sk" : {
4871+
"stringUnit" : {
4872+
"state" : "translated",
4873+
"value" : "API Key"
4874+
}
4875+
},
4876+
"zh-Hans" : {
4877+
"stringUnit" : {
4878+
"state" : "translated",
4879+
"value" : "API Key"
4880+
}
4881+
},
4882+
"zh-Hant" : {
4883+
"stringUnit" : {
4884+
"state" : "translated",
4885+
"value" : "API Key"
4886+
}
4887+
}
4888+
}
4889+
},
4890+
"service.configuration.doubao.model.title" : {
4891+
"localizations" : {
4892+
"en" : {
4893+
"stringUnit" : {
4894+
"state" : "translated",
4895+
"value" : "Model"
4896+
}
4897+
},
4898+
"sk" : {
4899+
"stringUnit" : {
4900+
"state" : "translated",
4901+
"value" : "Model"
4902+
}
4903+
},
4904+
"zh-Hans" : {
4905+
"stringUnit" : {
4906+
"state" : "translated",
4907+
"value" : "模型"
4908+
}
4909+
},
4910+
"zh-Hant" : {
4911+
"stringUnit" : {
4912+
"state" : "translated",
4913+
"value" : "模型"
4914+
}
4915+
}
4916+
}
4917+
},
47464918
"service.configuration.duplicate" : {
47474919
"localizations" : {
47484920
"en" : {

Easydict/Swift/Feature/Configuration/Defaults.Keys+Extension.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,10 @@ extension Defaults.Keys {
341341
// Volcano
342342
static let volcanoAccessKeyID = Key<String>(EZVolcanoAccessKeyID, default: "")
343343
static let volcanoSecretAccessKey = Key<String>(EZVolcanoSecretAccessKey, default: "")
344+
345+
// Doubao
346+
static let doubaoAPIKey = Key<String>(EZDoubaoAPIKey, default: "")
347+
static let doubaoModel = Key<String>(EZDoubaoModelKey, default: DoubaoService.defaultModelIdentifier)
344348
}
345349

346350
/// shortcut
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//
2+
// DoubaoResponse.swift
3+
// Easydict
4+
//
5+
// Created by Liaoworking on 2025/9/30.
6+
// Copyright © 2025 izual. All rights reserved.
7+
//
8+
9+
import Foundation
10+
11+
// MARK: - DoubaoStreamEvent
12+
13+
/// Represents a Doubao streaming event for SSE (Server-Sent Events) parsing
14+
/// Only the delta field is used for extracting incremental translation text
15+
struct DoubaoStreamEvent: Codable {
16+
/// The incremental translation text chunk
17+
let delta: String?
18+
}

0 commit comments

Comments
 (0)