From 0d4052a7712f7ec3d2c94c0631ee2f7410b8a676 Mon Sep 17 00:00:00 2001 From: Lava <34743145+CanglongCl@users.noreply.github.com> Date: Sat, 13 Jan 2024 19:25:20 -0800 Subject: [PATCH] filter classical Chinese in first/second language options --- Easydict/NewApp/Utility/Extensions/LanguageExtensions.swift | 4 ++-- Easydict/NewApp/View/SettingView/Tabs/GeneralTab.swift | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Easydict/NewApp/Utility/Extensions/LanguageExtensions.swift b/Easydict/NewApp/Utility/Extensions/LanguageExtensions.swift index 0f9668bda..b7cc84eae 100644 --- a/Easydict/NewApp/Utility/Extensions/LanguageExtensions.swift +++ b/Easydict/NewApp/Utility/Extensions/LanguageExtensions.swift @@ -16,8 +16,8 @@ extension Language: CaseIterable { Language(rawValue: rawValue as String) } - public static let allCasesWithoutAuto: [Language] = allCases.filter { language in - language != .auto + public static let allAvailableOptions: [Language] = allCases.filter { language in + language != .auto && language != .classicalChinese } } diff --git a/Easydict/NewApp/View/SettingView/Tabs/GeneralTab.swift b/Easydict/NewApp/View/SettingView/Tabs/GeneralTab.swift index 962bad4da..852631707 100644 --- a/Easydict/NewApp/View/SettingView/Tabs/GeneralTab.swift +++ b/Easydict/NewApp/View/SettingView/Tabs/GeneralTab.swift @@ -207,13 +207,13 @@ private struct FirstAndSecondLanguageSettingView: View { var body: some View { Group { Picker("setting.general.language.first_language", selection: $firstLanguage) { - ForEach(Language.allCasesWithoutAuto, id: \.rawValue) { option in + ForEach(Language.allAvailableOptions, id: \.rawValue) { option in Text(verbatim: "\(option.flagEmoji) \(option.localizedName)") .tag(option) } } Picker("setting.general.language.second_language", selection: $secondLanguage) { - ForEach(Language.allCasesWithoutAuto, id: \.rawValue) { option in + ForEach(Language.allAvailableOptions, id: \.rawValue) { option in Text(verbatim: "\(option.flagEmoji) \(option.localizedName)") .tag(option) }