Skip to content

Commit

Permalink
Merge branch 'dev' into update-TTSServiceType-key
Browse files Browse the repository at this point in the history
  • Loading branch information
CanglongCl authored Jan 17, 2024
2 parents 153ed92 + 63729d6 commit ab0b22b
Show file tree
Hide file tree
Showing 9 changed files with 84 additions and 63 deletions.
12 changes: 5 additions & 7 deletions Easydict.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
0309E1ED292B439A00AFB76A /* EZTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = 0309E1EC292B439A00AFB76A /* EZTextView.m */; };
0309E1F0292B4A5E00AFB76A /* NSView+EZGetViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0309E1EF292B4A5E00AFB76A /* NSView+EZGetViewController.m */; };
0309E1F4292BD6A100AFB76A /* EZQueryModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 0309E1F3292BD6A100AFB76A /* EZQueryModel.m */; };
030DB2612B56CC6500E27DEA /* BingLanguageVoice.swift in Sources */ = {isa = PBXBuildFile; fileRef = 030DB2602B56CC6500E27DEA /* BingLanguageVoice.swift */; };
0310C8272A94F5DF00B1D81E /* apple-dictionary.html in Resources */ = {isa = PBXBuildFile; fileRef = 0310C8262A94EFA100B1D81E /* apple-dictionary.html */; };
0313F8702AD5577400A5CFB0 /* EasydictTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 0313F86F2AD5577400A5CFB0 /* EasydictTests.m */; };
031DBD792AE01E130071CF85 /* easydict in Resources */ = {isa = PBXBuildFile; fileRef = 031DBD782AE01E130071CF85 /* easydict */; };
Expand Down Expand Up @@ -66,7 +67,6 @@
037852B329583F5200D0E2CF /* EZServiceCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 037852B229583F5200D0E2CF /* EZServiceCell.m */; };
037852B629588EDE00D0E2CF /* EZCustomTableRowView.m in Sources */ = {isa = PBXBuildFile; fileRef = 037852B529588EDE00D0E2CF /* EZCustomTableRowView.m */; };
037852B9295D49F900D0E2CF /* EZTableRowView.m in Sources */ = {isa = PBXBuildFile; fileRef = 037852B8295D49F900D0E2CF /* EZTableRowView.m */; };
037BEFCD2A98FDF700D0F17F /* EZBingLanguageVoice.m in Sources */ = {isa = PBXBuildFile; fileRef = 037BEFCC2A98FDF700D0F17F /* EZBingLanguageVoice.m */; };
037E006D2B3DC098006491C6 /* EZOpenAIService+EZPromptMessages.m in Sources */ = {isa = PBXBuildFile; fileRef = 03CF27FA2B3A787900E19B57 /* EZOpenAIService+EZPromptMessages.m */; };
038030952B4106800009230C /* CocoaLumberjack in Frameworks */ = {isa = PBXBuildFile; productRef = 038030942B4106800009230C /* CocoaLumberjack */; };
038030972B4106800009230C /* CocoaLumberjackSwift in Frameworks */ = {isa = PBXBuildFile; productRef = 038030962B4106800009230C /* CocoaLumberjackSwift */; };
Expand Down Expand Up @@ -325,6 +325,7 @@
0309E1EF292B4A5E00AFB76A /* NSView+EZGetViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSView+EZGetViewController.m"; sourceTree = "<group>"; };
0309E1F2292BD6A100AFB76A /* EZQueryModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = EZQueryModel.h; sourceTree = "<group>"; };
0309E1F3292BD6A100AFB76A /* EZQueryModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = EZQueryModel.m; sourceTree = "<group>"; };
030DB2602B56CC6500E27DEA /* BingLanguageVoice.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BingLanguageVoice.swift; sourceTree = "<group>"; };
0310C8262A94EFA100B1D81E /* apple-dictionary.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; path = "apple-dictionary.html"; sourceTree = "<group>"; };
0313F86D2AD5577400A5CFB0 /* EasydictTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = EasydictTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
0313F86F2AD5577400A5CFB0 /* EasydictTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = EasydictTests.m; sourceTree = "<group>"; };
Expand Down Expand Up @@ -414,8 +415,6 @@
037852B529588EDE00D0E2CF /* EZCustomTableRowView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = EZCustomTableRowView.m; sourceTree = "<group>"; };
037852B7295D49F900D0E2CF /* EZTableRowView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = EZTableRowView.h; sourceTree = "<group>"; };
037852B8295D49F900D0E2CF /* EZTableRowView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = EZTableRowView.m; sourceTree = "<group>"; };
037BEFCB2A98FDF700D0F17F /* EZBingLanguageVoice.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = EZBingLanguageVoice.h; sourceTree = "<group>"; };
037BEFCC2A98FDF700D0F17F /* EZBingLanguageVoice.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = EZBingLanguageVoice.m; sourceTree = "<group>"; };
03839141292FBE120009828C /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Main.strings"; sourceTree = "<group>"; };
03839142292FBE120009828C /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
03839143292FBE120009828C /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
Expand Down Expand Up @@ -2091,8 +2090,7 @@
6295DE302A84D82E006145F4 /* EZBingTranslateModel.m */,
6295DE322A84EF76006145F4 /* EZBingLookupModel.h */,
6295DE332A84EF76006145F4 /* EZBingLookupModel.m */,
037BEFCB2A98FDF700D0F17F /* EZBingLanguageVoice.h */,
037BEFCC2A98FDF700D0F17F /* EZBingLanguageVoice.m */,
030DB2602B56CC6500E27DEA /* BingLanguageVoice.swift */,
03F639932AA6CFBB009B9914 /* EZBingConfig.h */,
03F639942AA6CFBB009B9914 /* EZBingConfig.m */,
);
Expand Down Expand Up @@ -2467,7 +2465,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "# Type a script or drag a script file from your workspace to insert its path.\n\"${PODS_ROOT}/SwiftFormat/CommandLineTool/swiftformat\" \"$SRCROOT/$TARGET_NAME\" --swiftversion 5.7\n";
shellScript = "# Type a script or drag a script file from your workspace to insert its path.\nif [ \"${ENABLE_PREVIEWS}\" = \"YES\" ]; then\n echo \"SwiftFormat skipped for Xcode Previews.\"\n exit 0;\nfi\n\"${PODS_ROOT}/SwiftFormat/CommandLineTool/swiftformat\" \"$SRCROOT/$TARGET_NAME\" --swiftversion 5.7\n";
};
124D690EE7236D6430CF945E /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
Expand Down Expand Up @@ -2586,7 +2584,6 @@
03991158292927E000E1B06D /* EZTitlebar.m in Sources */,
03D8A65C2A433B4100D9A968 /* EZConfiguration+EZUserData.m in Sources */,
03BD282229486CF200F5891A /* EZBlueTextButton.m in Sources */,
037BEFCD2A98FDF700D0F17F /* EZBingLanguageVoice.m in Sources */,
03BDA7C22A26DA280079D04F /* NSString+Indenter.m in Sources */,
03542A462937B4C300C34C33 /* EZBaiduTranslateResponse.m in Sources */,
0309E1F0292B4A5E00AFB76A /* NSView+EZGetViewController.m in Sources */,
Expand Down Expand Up @@ -2722,6 +2719,7 @@
0333FDA62A035D5700891515 /* NSString+EZChineseText.m in Sources */,
03E02A222924E77100A10260 /* EZMenuItemManager.m in Sources */,
039D119929D5E26300C93F46 /* EZAudioUtils.m in Sources */,
030DB2612B56CC6500E27DEA /* BingLanguageVoice.swift in Sources */,
EA9943F22B5358BF00EE7B97 /* LanguageExtensions.swift in Sources */,
03B0231729231FA6001C7E63 /* Snip.m in Sources */,
03BFFC6E295FE59C004E033E /* EZQueryResult+EZYoudaoDictModel.m in Sources */,
Expand Down
2 changes: 1 addition & 1 deletion Easydict.xcworkspace/xcshareddata/swiftpm/Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
{
"identity" : "alamofire",
"kind" : "remoteSourceControl",
"location" : "https://github.com/Alamofire/Alamofire.git",
"location" : "https://github.com/Alamofire/Alamofire",
"state" : {
"revision" : "3dc6a42c7727c49bf26508e29b0a0b35f9c7e1ad",
"version" : "5.8.1"
Expand Down
55 changes: 46 additions & 9 deletions Easydict/App/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@
"sourceLanguage" : "en",
"strings" : {
"" : {

"localizations" : {
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
"value" : ""
}
}
}
},
"about" : {
"comment" : "about",
Expand Down Expand Up @@ -490,9 +497,15 @@
},
"beta_new_app" : {
"localizations" : {
"zh-Hans" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "[Beta] SwiftUI App mode"
}
},
"zh-Hans" : {
"stringUnit" : {
"state" : "needs_review",
"value" : "[Beta] SwiftUI App模式"
}
}
Expand Down Expand Up @@ -560,6 +573,12 @@
},
"check_updates" : {
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Check for Updates"
}
},
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
Expand Down Expand Up @@ -908,9 +927,15 @@
},
"enable_beta_new_app" : {
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Launching in SwiftUI App mode, changes take effect upon restarting the app."
}
},
"zh-Hans" : {
"stringUnit" : {
"state" : "needs_review",
"state" : "translated",
"value" : "以 SwiftUI App模式启动,重启App生效"
}
}
Expand Down Expand Up @@ -1666,7 +1691,7 @@
},
"zh-Hans" : {
"stringUnit" : {
"state" : "needs_review",
"state" : "translated",
"value" : "输入翻译"
}
}
Expand All @@ -1683,7 +1708,7 @@
},
"zh-Hans" : {
"stringUnit" : {
"state" : "needs_review",
"state" : "translated",
"value" : "截图翻译"
}
}
Expand All @@ -1699,7 +1724,7 @@
},
"zh-Hans" : {
"stringUnit" : {
"state" : "needs_review",
"state" : "translated",
"value" : "划词翻译"
}
}
Expand All @@ -1715,7 +1740,7 @@
},
"zh-Hans" : {
"stringUnit" : {
"state" : "needs_review",
"state" : "translated",
"value" : "显示迷你窗口"
}
}
Expand All @@ -1731,7 +1756,7 @@
},
"zh-Hans" : {
"stringUnit" : {
"state" : "needs_review",
"state" : "translated",
"value" : "静默截图 OCR"
}
}
Expand Down Expand Up @@ -2180,6 +2205,12 @@
},
"quit" : {
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Quit"
}
},
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
Expand Down Expand Up @@ -2599,7 +2630,7 @@
},
"zh-Hans" : {
"stringUnit" : {
"state" : "needs_review",
"state" : "translated",
"value" : "调整查询图标位置(避免和 PopClip 显示冲突)"
}
}
Expand Down Expand Up @@ -2639,6 +2670,12 @@
},
"setting.general.voice.auto_play_word_audio" : {
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Auto play pronunciation after querying English words"
}
},
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
Expand Down
26 changes: 26 additions & 0 deletions Easydict/Feature/Service/Bing/BingLanguageVoice.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//
// BingLanguageVoice.swift
// Easydict
//
// Created by Jerry on 2023-10-14.
// Copyright © 2023 izual. All rights reserved.
//

import Foundation

// Docs: https://learn.microsoft.com/zh-cn/azure/ai-services/speech-service/language-support?tabs=tts

@objc(EZBingLanguageVoice)
class BingLanguageVoice: NSObject {
@objc var lang: String // BCP-47, en-US
@objc var voiceName: String // en-US-JennyNeural

init(lang: String, voiceName: String) {
self.lang = lang
self.voiceName = voiceName
}

@objc class func voice(withLanguage language: String, voiceName: String) -> BingLanguageVoice {
BingLanguageVoice(lang: language, voiceName: voiceName)
}
}
24 changes: 0 additions & 24 deletions Easydict/Feature/Service/Bing/EZBingLanguageVoice.h

This file was deleted.

20 changes: 0 additions & 20 deletions Easydict/Feature/Service/Bing/EZBingLanguageVoice.m

This file was deleted.

2 changes: 1 addition & 1 deletion Easydict/Feature/Service/Bing/EZBingRequest.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

#import "EZBingRequest.h"
#import "EZError.h"
#import "EZBingLanguageVoice.h"
#import "NSString+EZRegex.h"
#import "Easydict-Swift.h"

static NSString *const kAudioMIMEType = @"audio/mpeg";
static NSString *const kBingConfigKey = @"kBingConfigKey";
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ Easydict 有一些应用内快捷键,方便你在使用过程中更加高效

## 致谢

- /是以 [Bob (GPL-3.0)](https://github.com/1xiaocainiao/Bob) 为基础开发。Easydict 在原项目上进行了许多改进和优化,很多功能和 UI 都参考了 Bob。
- 这个项目的灵感来自 [saladict](https://github.com/crimx/ext-saladict)[Bob](https://github.com/ripperhe/Bob),且初始版本是以 [Bob (GPL-3.0)](https://github.com/1xiaocainiao/Bob) 为基础开发。Easydict 在原项目上进行了许多改进和优化,很多功能和 UI 都参考了 Bob。
- 截图功能是基于 [isee15](https://github.com/isee15)[Capture-Screen-For-Multi-Screens-On-Mac](https://github.com/isee15/Capture-Screen-For-Multi-Screens-On-Mac),并在此基础上进行了优化。
- 鼠标划词功能参考了 [PopClip](https://pilotmoon.com/popclip/)

Expand Down Expand Up @@ -821,6 +821,8 @@ Easydict 作为一个免费开源的非盈利项目,目前主要是作者个
| 2023-12-07 | 小逗。🎈 | 5 | |
| 2023-12-26 | ㅤ Yee | 5 | 感谢开源 |
| 2024-01-09 | ㅤ Jack | 20 | 目前用过最好用的字典软件,谢谢! |
| 2024-01-15 || 20 | 感谢开源,感谢有你:) |
| 2024-01-16 | ㅤ sd | 5 | 大佬牛逼🐂🍺 |

</p>

Expand Down
2 changes: 2 additions & 0 deletions README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -818,6 +818,8 @@ If you don't want your username to be displayed in the list, please choose anony
| 2023-12-07 | 小逗。🎈 | 5 | |
| 2023-12-26 | ㅤ Yee | 5 | 感谢开源 |
| 2024-01-09 | ㅤ Jack | 20 | 目前用过最好用的字典软件,谢谢! |
| 2024-01-15 || 20 | 感谢开源,感谢有你:) |
| 2024-01-16 | ㅤ sd | 5 | 大佬牛逼🐂🍺 |

</p>

Expand Down

0 comments on commit ab0b22b

Please sign in to comment.