diff --git a/Easydict/NewApp/Configuration/Configuration.swift b/Easydict/NewApp/Configuration/Configuration.swift index 9ecdff830..976ab72f5 100644 --- a/Easydict/NewApp/Configuration/Configuration.swift +++ b/Easydict/NewApp/Configuration/Configuration.swift @@ -33,7 +33,6 @@ extension Defaults.Keys { static let autoCopySelectedText = Key("EZConfiguration_kAutoCopySelectedTextKey", default: false) static let autoCopyFirstTranslatedText = Key("EZConfiguration_kAutoCopyFirstTranslatedTextKey", default: false) static let languageDetectOptimize = Key("EZConfiguration_kLanguageDetectOptimizeTypeKey", default: EZLanguageDetectOptimize.none) - @available(macOS 13, *) static let defaultTTSServiceType = Key("EZConfiguration_kDefaultTTSServiceTypeKey", default: TTSServiceType.youdao) static let showGoogleQuickLink = Key("EZConfiguration_kShowGoogleLinkKey", default: true) static let showEudicQuickLink = Key("EZConfiguration_kShowEudicLinkKey", default: true) diff --git a/Easydict/NewApp/Model/TTSServiceType.swift b/Easydict/NewApp/Model/TTSServiceType.swift index 6eda5cf16..c28ef5938 100644 --- a/Easydict/NewApp/Model/TTSServiceType.swift +++ b/Easydict/NewApp/Model/TTSServiceType.swift @@ -9,8 +9,16 @@ import Defaults import Foundation +enum TTSServiceType: String, CaseIterable { + case youdao + case bing + case google + case baidu + case apple +} + @available(macOS 13, *) -enum TTSServiceType: String, CaseIterable, CustomLocalizedStringResourceConvertible { +extension TTSServiceType: CustomLocalizedStringResourceConvertible { var localizedStringResource: LocalizedStringResource { switch self { case .youdao: @@ -25,15 +33,8 @@ enum TTSServiceType: String, CaseIterable, CustomLocalizedStringResourceConverti "setting.tts_service.options.apple" } } - - case youdao - case bing - case google - case baidu - case apple } -@available(macOS 13, *) extension TTSServiceType: Defaults.Serializable { // while in the future, ServiceType was deleted, then you can safely delete this struct and `bridge` struct TTSServiceTypeBridge: Defaults.Bridge {