From ecdf45e44711b02ee1035a3e4df71a22c3e72137 Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Mon, 26 Sep 2022 11:34:20 +0800 Subject: [PATCH] Remove Change Language button, add German and Spanish options --- .../Sources/App/Views/AudioPlayer/MiniPlayer.swift | 1 - .../Services/AudioSession/AudioController.swift | 12 +++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/apple/OmnivoreKit/Sources/App/Views/AudioPlayer/MiniPlayer.swift b/apple/OmnivoreKit/Sources/App/Views/AudioPlayer/MiniPlayer.swift index 2a4ceb01a..d17521415 100644 --- a/apple/OmnivoreKit/Sources/App/Views/AudioPlayer/MiniPlayer.swift +++ b/apple/OmnivoreKit/Sources/App/Views/AudioPlayer/MiniPlayer.swift @@ -311,7 +311,6 @@ public struct MiniPlayer: View { Menu { Button("View Article", action: { viewArticle() }) Button("Change Voice", action: { showVoiceSheet = true }) - Button("Change Language", action: { showLanguageSheet = true }) } label: { VStack { Image(systemName: "ellipsis") diff --git a/apple/OmnivoreKit/Sources/Services/AudioSession/AudioController.swift b/apple/OmnivoreKit/Sources/Services/AudioSession/AudioController.swift index f56afb9b3..158727d4c 100644 --- a/apple/OmnivoreKit/Sources/Services/AudioSession/AudioController.swift +++ b/apple/OmnivoreKit/Sources/Services/AudioSession/AudioController.swift @@ -47,6 +47,8 @@ public enum VoiceCategory: String, CaseIterable { case enIN = "English (India)" case enSG = "English (Singapore)" case enUK = "English (UK)" + case deDE = "German (Germany)" + case esES = "Spanish (Spain)" case jaJP = "Japanese (Japan)" case zhCN = "Chinese (China Mainland)" } @@ -69,8 +71,11 @@ private let ENGLISH = VoiceLanguage(key: "en", public let VOICELANGUAGES = [ ENGLISH, + VoiceLanguage(key: "zh", name: "Chinese", defaultVoice: "zh-CN-XiaochenNeural", categories: [.zhCN]), VoiceLanguage(key: "ja", name: "Japanese", defaultVoice: "ja-JP-NanamiNeural", categories: [.jaJP]), - VoiceLanguage(key: "zh", name: "Chinese", defaultVoice: "zh-CN-XiaochenNeural", categories: [.zhCN]) + VoiceLanguage(key: "ja", name: "Japanese", defaultVoice: "ja-JP-NanamiNeural", categories: [.jaJP]), + VoiceLanguage(key: "de", name: "German", defaultVoice: "de-CH-JanNeural", categories: [.deDE]), + VoiceLanguage(key: "es", name: "Spanish", defaultVoice: "es-ES-AlvaroNeural", categories: [.esES]) ] // swiftlint:disable all @@ -86,6 +91,11 @@ public let VOICES = [ VoicePair(firstKey: "en-IN-NeerjaNeural", secondKey: "en-IN-PrabhatNeural", firstName: "Neerja", secondName: "Prabhat", language: "en-IN", category: .enIN), VoicePair(firstKey: "en-SG-LunaNeural", secondKey: "en-SG-WayneNeural", firstName: "Luna", secondName: "Wayne", language: "en-SG", category: .enSG), + VoicePair(firstKey: "es-ES-AlvaroNeural", secondKey: "es-ES-ElviraNeural", firstName: "Alvaro", secondName: "Elvira", language: "es-ES", category: .esES), + VoicePair(firstKey: "de-CH-LeniNeural", secondKey: "de-DE-KatjaNeural", firstName: "Leni", secondName: "Katja", language: "de-DE", category: .deDE), + VoicePair(firstKey: "de-DE-AmalaNeural", secondKey: "de-DE-BerndNeural", firstName: "Amala", secondName: "Bernd", language: "de-DE", category: .deDE), + VoicePair(firstKey: "de-DE-ChristophNeural", secondKey: "de-DE-LouisaNeural", firstName: "Christoph", secondName: "Louisa", language: "de-DE", category: .deDE), + // ja VoicePair(firstKey: "ja-JP-NanamiNeural", secondKey: "ja-JP-KeitaNeural", firstName: "Nanami", secondName: "Keita", language: "ja-JP", category: .jaJP),