Skip to content

Commit bf0d345

Browse files
committed
Update the default region per base language using https://github.com/HadrienGardeur/web-speech-recommended-voices
1 parent f315359 commit bf0d345

1 file changed

Lines changed: 12 additions & 11 deletions

File tree

Sources/Navigator/TTS/TTSVoice.swift

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -181,52 +181,53 @@ private extension Locale {
181181
}
182182

183183
// Default region per base language.
184+
// Source: https://github.com/HadrienGardeur/web-speech-recommended-voices
184185
private let defaultRegionByLanguage: [Language.Code: Language.Region] = [
186+
.bcp47("ar"): "SA",
185187
.bcp47("bg"): "BG",
186-
.bcp47("bn"): "BD",
188+
.bcp47("bho"): "IN",
189+
.bcp47("bn"): "IN",
190+
.bcp47("ca"): "ES",
191+
.bcp47("cmn"): "CN",
187192
.bcp47("cs"): "CZ",
188193
.bcp47("da"): "DK",
189194
.bcp47("de"): "DE",
190195
.bcp47("el"): "GR",
191196
.bcp47("en"): "US",
192197
.bcp47("es"): "ES",
193-
.bcp47("et"): "EE",
198+
.bcp47("eu"): "ES",
194199
.bcp47("fa"): "IR",
195200
.bcp47("fi"): "FI",
196-
.bcp47("fil"): "PH",
197201
.bcp47("fr"): "FR",
202+
.bcp47("gl"): "ES",
198203
.bcp47("he"): "IL",
199204
.bcp47("hi"): "IN",
200205
.bcp47("hr"): "HR",
201206
.bcp47("hu"): "HU",
202207
.bcp47("id"): "ID",
203-
.bcp47("is"): "IS",
204208
.bcp47("it"): "IT",
205209
.bcp47("ja"): "JP",
210+
.bcp47("kn"): "IN",
206211
.bcp47("ko"): "KR",
207-
.bcp47("lt"): "LT",
208-
.bcp47("lv"): "LV",
209212
.bcp47("mr"): "IN",
210213
.bcp47("ms"): "MY",
211214
.bcp47("nb"): "NO",
212215
.bcp47("nl"): "NL",
213-
.bcp47("nn"): "NO",
214216
.bcp47("pl"): "PL",
215-
.bcp47("pt"): "PT",
217+
.bcp47("pt"): "BR",
216218
.bcp47("ro"): "RO",
217219
.bcp47("ru"): "RU",
218220
.bcp47("sk"): "SK",
219221
.bcp47("sl"): "SI",
220-
.bcp47("sr"): "RS",
221222
.bcp47("sv"): "SE",
222223
.bcp47("ta"): "IN",
223224
.bcp47("te"): "IN",
224225
.bcp47("th"): "TH",
225226
.bcp47("tr"): "TR",
226227
.bcp47("uk"): "UA",
227-
.bcp47("ur"): "PK",
228228
.bcp47("vi"): "VN",
229-
.bcp47("zh"): "CN",
229+
.bcp47("wuu"): "CN",
230+
.bcp47("yue"): "HK",
230231
]
231232

232233
// Quality order priority: higher to lower

0 commit comments

Comments
 (0)