Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
tisfeng committed Feb 25, 2024
2 parents 5474af6 + c9f735a commit 88474a9
Show file tree
Hide file tree
Showing 46 changed files with 327 additions and 316 deletions.
4 changes: 1 addition & 3 deletions .github/ISSUE_TEMPLATE/cn_bug_report_zh.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: 反馈问题
description: 反馈问题
title: "🐞 反馈问题:请填写标题,不要留空"
title: "🐞 反馈问题:{{请填写标题,不要留空}}"
labels: ["bug"]

body:
Expand All @@ -9,8 +9,6 @@ body:
attributes:
label: 请先确认以下事项:
options:
- label: 请务必查看 [常见问题](https://github.com/tisfeng/Easydict/wiki/%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98)
required: true
- label: 已仔细阅读了 [README](https://github.com/tisfeng/Easydict#readme)
required: true
- label: 在 [issues](https://github.com/tisfeng/Easydict/issues) 页面搜索过问题(包括已关闭的 issue),但未能找到解决方法
Expand Down
4 changes: 1 addition & 3 deletions .github/ISSUE_TEMPLATE/en_bug_report.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Bug report
description: Report an issue
title: "🐞 Bug Report: Please fill in the title, don't leave it blank"
title: "🐞 Bug Report: {{Please fill in the title, don't leave it blank}} "
labels: ["bug"]

body:
Expand All @@ -9,8 +9,6 @@ body:
attributes:
label: "Please confirm the following:"
options:
- label: Be sure to check out [FAQ](https://github.com/tisfeng/Easydict/wiki/FAQ)
required: true
- label: I have carefully read the [README](https://github.com/tisfeng/Easydict#readme)
required: true
- label: I have searched through the [issues](https://github.com/tisfeng/Easydict/issues) page but couldn't find a solution.(Including issue that has been closed)
Expand Down
30 changes: 0 additions & 30 deletions .github/workflows/objective-c-xcode.yml

This file was deleted.

22 changes: 0 additions & 22 deletions .github/workflows/swift.yml

This file was deleted.

1 change: 1 addition & 0 deletions .swift-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
5.9
4 changes: 4 additions & 0 deletions .swiftformat
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# https://github.com/nicklockwood/SwiftFormat/blob/main/Rules.md

# file options
--exclude Pods
26 changes: 13 additions & 13 deletions Easydict.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,6 @@
278322622B0FB8EF0026644C /* CaiyunTranslateType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 278322612B0FB8EF0026644C /* CaiyunTranslateType.swift */; };
278540342B3DE04F004E9488 /* GeneralTab.swift in Sources */ = {isa = PBXBuildFile; fileRef = 278540332B3DE04F004E9488 /* GeneralTab.swift */; };
27FE95272B3DC55F000AD654 /* EasydictApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27FE95262B3DC55F000AD654 /* EasydictApp.swift */; };
27FE98052B3DCB09000AD654 /* NewAppManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27FE98042B3DCB09000AD654 /* NewAppManager.swift */; };
27FE98092B3DD536000AD654 /* SettingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27FE98082B3DD536000AD654 /* SettingView.swift */; };
27FE980B2B3DD5D1000AD654 /* MenuItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27FE980A2B3DD5D1000AD654 /* MenuItemView.swift */; };
6220AD5B2A82812300BBFB52 /* EZBingService.m in Sources */ = {isa = PBXBuildFile; fileRef = 6220AD5A2A82812300BBFB52 /* EZBingService.m */; };
Expand All @@ -279,6 +278,7 @@
9643D93D2B6F829C000FBEA6 /* MainMenuCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9643D93C2B6F829C000FBEA6 /* MainMenuCommand.swift */; };
9643D9402B6FC426000FBEA6 /* MainMenuShortcutCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9643D93F2B6FC426000FBEA6 /* MainMenuShortcutCommand.swift */; };
9643D9422B6FE4AF000FBEA6 /* Shortcut+Bind.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9643D9412B6FE4AF000FBEA6 /* Shortcut+Bind.swift */; };
9643D9442B6FEF5F000FBEA6 /* Shortcut+Default.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9643D9432B6FEF5F000FBEA6 /* Shortcut+Default.swift */; };
9643D9462B71D103000FBEA6 /* KeyHolderRowView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9643D9452B71D103000FBEA6 /* KeyHolderRowView.swift */; };
9643D94A2B71EABE000FBEA6 /* KeyHolderAlterView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9643D9492B71EABE000FBEA6 /* KeyHolderAlterView.swift */; };
9643D94C2B71F74D000FBEA6 /* MainMenuShortcutCommandItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9643D94B2B71F74D000FBEA6 /* MainMenuShortcutCommandItem.swift */; };
Expand Down Expand Up @@ -774,7 +774,6 @@
27B791A02AEC3A5C006E07C6 /* Easydict-debug.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = "Easydict-debug.entitlements"; sourceTree = "<group>"; };
27FE95262B3DC55F000AD654 /* EasydictApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EasydictApp.swift; sourceTree = "<group>"; };
27FE95282B3DC666000AD654 /* entry.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = entry.h; sourceTree = "<group>"; };
27FE98042B3DCB09000AD654 /* NewAppManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NewAppManager.swift; sourceTree = "<group>"; };
27FE98082B3DD536000AD654 /* SettingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingView.swift; sourceTree = "<group>"; };
27FE980A2B3DD5D1000AD654 /* MenuItemView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MenuItemView.swift; sourceTree = "<group>"; };
357E179B303EF855EF4561FB /* Pods-EasydictTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-EasydictTests.release.xcconfig"; path = "Target Support Files/Pods-EasydictTests/Pods-EasydictTests.release.xcconfig"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -802,6 +801,7 @@
9643D93C2B6F829C000FBEA6 /* MainMenuCommand.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainMenuCommand.swift; sourceTree = "<group>"; };
9643D93F2B6FC426000FBEA6 /* MainMenuShortcutCommand.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainMenuShortcutCommand.swift; sourceTree = "<group>"; };
9643D9412B6FE4AF000FBEA6 /* Shortcut+Bind.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Shortcut+Bind.swift"; sourceTree = "<group>"; };
9643D9432B6FEF5F000FBEA6 /* Shortcut+Default.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Shortcut+Default.swift"; sourceTree = "<group>"; };
9643D9452B71D103000FBEA6 /* KeyHolderRowView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeyHolderRowView.swift; sourceTree = "<group>"; };
9643D9492B71EABE000FBEA6 /* KeyHolderAlterView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeyHolderAlterView.swift; sourceTree = "<group>"; };
9643D94B2B71F74D000FBEA6 /* MainMenuShortcutCommandItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainMenuShortcutCommandItem.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -2138,7 +2138,6 @@
EA9943DD2B534BAE00EE7B97 /* Utility */,
EA3B81F72B52549B004C0E8B /* Configuration */,
27FE95262B3DC55F000AD654 /* EasydictApp.swift */,
27FE98042B3DCB09000AD654 /* NewAppManager.swift */,
27FE98062B3DD525000AD654 /* View */,
);
path = NewApp;
Expand Down Expand Up @@ -2270,6 +2269,7 @@
isa = PBXGroup;
children = (
967712ED2B5B943400105E0F /* Shortcut.swift */,
9643D9432B6FEF5F000FBEA6 /* Shortcut+Default.swift */,
9643D9412B6FE4AF000FBEA6 /* Shortcut+Bind.swift */,
9608354F2B6791F200C6A931 /* Shortcut+Validator.swift */,
9643D9552B73B3CD000FBEA6 /* Shortcut+Menu.swift */,
Expand Down Expand Up @@ -2679,7 +2679,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
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";
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\"\n";
};
124D690EE7236D6430CF945E /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
Expand Down Expand Up @@ -2969,7 +2969,6 @@
03BB2DE329F5772F00447EDD /* EZAudioButton.m in Sources */,
03262C2529EFE97B00EFECA0 /* NSViewController+EZWindow.m in Sources */,
03008B2729408BF50062B821 /* NSObject+EZDarkMode.m in Sources */,
27FE98052B3DCB09000AD654 /* NewAppManager.swift in Sources */,
0399116A292AA2EF00E1B06D /* EZLayoutManager.m in Sources */,
0320C5872B29F35700861B3D /* QueryServiceRecord.swift in Sources */,
9643D9422B6FE4AF000FBEA6 /* Shortcut+Bind.swift in Sources */,
Expand Down Expand Up @@ -3000,6 +2999,7 @@
03BDA7B92A26DA280079D04F /* NSProcessInfo+XPMArgumentParser.m in Sources */,
03542A4F2937B64B00C34C33 /* EZYoudaoOCRResponse.m in Sources */,
03B0233929231FA6001C7E63 /* MMTool.m in Sources */,
9643D9442B6FEF5F000FBEA6 /* Shortcut+Default.swift in Sources */,
03542A552937B7DE00C34C33 /* EZError.m in Sources */,
17BCAEF72B0DFF9000A7D372 /* EZNiuTransTranslateResponse.m in Sources */,
03BDA7B82A26DA280079D04F /* XPMValuedArgument.m in Sources */,
Expand Down Expand Up @@ -3202,7 +3202,7 @@
CODE_SIGN_IDENTITY = $CODE_SIGN_IDENTITY;
CODE_SIGN_STYLE = $CODE_SIGN_STYLE;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 32;
CURRENT_PROJECT_VERSION = 33;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = "$(DEVELOPMENT_TEAM)";
ENABLE_HARDENED_RUNTIME = YES;
Expand All @@ -3213,7 +3213,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 2.6.0;
MARKETING_VERSION = 2.6.1;
PRODUCT_BUNDLE_IDENTIFIER = "com.izual.EasydictHelper-debug";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
Expand All @@ -3228,7 +3228,7 @@
CODE_SIGN_IDENTITY = $CODE_SIGN_IDENTITY;
CODE_SIGN_STYLE = $CODE_SIGN_STYLE;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 32;
CURRENT_PROJECT_VERSION = 33;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = "$(DEVELOPMENT_TEAM)";
ENABLE_HARDENED_RUNTIME = YES;
Expand All @@ -3239,7 +3239,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 2.6.0;
MARKETING_VERSION = 2.6.1;
PRODUCT_BUNDLE_IDENTIFIER = com.izual.EasydictHelper;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
Expand Down Expand Up @@ -3385,7 +3385,7 @@
CODE_SIGN_STYLE = $CODE_SIGN_STYLE;
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 32;
CURRENT_PROJECT_VERSION = 33;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = "$(DEVELOPMENT_TEAM)";
ENABLE_HARDENED_RUNTIME = YES;
Expand All @@ -3400,7 +3400,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 2.6.0;
MARKETING_VERSION = 2.6.1;
PRODUCT_BUNDLE_IDENTIFIER = "com.izual.Easydict-debug";
PRODUCT_MODULE_NAME = Easydict;
PRODUCT_NAME = "Easydict-debug";
Expand All @@ -3425,7 +3425,7 @@
CODE_SIGN_STYLE = $CODE_SIGN_STYLE;
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 32;
CURRENT_PROJECT_VERSION = 33;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = "$(DEVELOPMENT_TEAM)";
ENABLE_HARDENED_RUNTIME = YES;
Expand All @@ -3440,7 +3440,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 2.6.0;
MARKETING_VERSION = 2.6.1;
PRODUCT_BUNDLE_IDENTIFIER = com.izual.Easydict;
PRODUCT_MODULE_NAME = Easydict;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down
2 changes: 1 addition & 1 deletion Easydict/App/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
[EZLog setupCrashLogService];
[EZLog logAppInfo];

if (!EasydictNewAppManager.shared.enable) {
if (!Configuration.shared.enableBetaNewApp) {
[EZMenuItemManager.shared setup];
[EZShortcut setup];
} else {
Expand Down
22 changes: 19 additions & 3 deletions Easydict/App/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -533,13 +533,13 @@
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "[Beta] SwiftUI App mode"
"value" : "SwiftUI App mode:"
}
},
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
"value" : "[Beta] SwiftUI App模式"
"value" : "SwiftUI App模式"
}
}
}
Expand Down Expand Up @@ -1765,6 +1765,22 @@
}
}
},
"menu_feedback" : {
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Feedback"
}
},
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
"value" : "反馈"
}
}
}
},
"menu_input_translate" : {
"extractionState" : "manual",
"localizations" : {
Expand Down Expand Up @@ -3357,7 +3373,7 @@
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
"value" : "划词内容为空时"
"value" : "禁用空复制提示音"
}
}
}
Expand Down
12 changes: 6 additions & 6 deletions Easydict/Feature/Configuration/Appearance.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,22 @@ import Foundation
var title: String {
switch self {
case .followSystem:
return NSLocalizedString("appearenceType_followSystem", comment: "")
NSLocalizedString("appearenceType_followSystem", comment: "")
case .light:
return NSLocalizedString("appearenceType_light", comment: "")
NSLocalizedString("appearenceType_light", comment: "")
case .dark:
return NSLocalizedString("appearenceType_dark", comment: "")
NSLocalizedString("appearenceType_dark", comment: "")
}
}

var appearence: NSAppearance? {
switch self {
case .followSystem:
return nil
nil
case .light:
return NSAppearance(named: .aqua)
NSAppearance(named: .aqua)
case .dark:
return NSAppearance(named: .darkAqua)
NSAppearance(named: .darkAqua)
}
}

Expand Down
4 changes: 2 additions & 2 deletions Easydict/Feature/Configuration/Configuration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ let kHideMenuBarIconKey = "EZConfiguration_kHideMenuBarIconKey"
)

cancellables.append(
Defaults.publisher(.launchAtStartup)
Defaults.publisher(.launchAtStartup, options: [])
.removeDuplicates()
.sink { [weak self] change in
self?.didSetLaunchAtStartup(change.oldValue, new: change.newValue)
Expand Down Expand Up @@ -542,7 +542,7 @@ private extension Configuration {
}

func didSetHideMenuBarIcon() {
if !NewAppManager.shared.enable {
if !Configuration.shared.enableBetaNewApp {
hideMenuBarIcon(hidden: hideMenuBarIcon)
}

Expand Down
2 changes: 1 addition & 1 deletion Easydict/Feature/Configuration/EZConfiguration.m
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ - (void)setHideMenuBarIcon:(BOOL)hideMenuBarIcon {

[NSUserDefaults mm_write:@(hideMenuBarIcon) forKey:kHideMenuBarIconKey];

if (!EasydictNewAppManager.shared.enable) {
if (!Configuration.shared.enableBetaNewApp) {
[self hideMenuBarIcon:hideMenuBarIcon];
}

Expand Down
4 changes: 2 additions & 2 deletions Easydict/Feature/Service/Ali/AliResponse.swift
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,9 @@ enum AnyCodable: Codable {
var stringValue: String? {
switch self {
case let .int(i):
return String(i)
String(i)
case let .string(s):
return s
s
}
}
}
Loading

0 comments on commit 88474a9

Please sign in to comment.