We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1a5c106 commit ce69070Copy full SHA for ce69070
2 files changed
Core/Sources/Preferences/ChatGPTLanguage.swift
Core/Sources/Preferences/Locale.swift
@@ -0,0 +1,15 @@
1
+import Foundation
2
+
3
+public extension Locale {
4
+ static var availableLocales: [Locale] {
5
+ Locale.availableIdentifiers.compactMap(Locale.init).reduce(into: []) { (locales, locale) in
6
+ if !locales.contains(where: { $0.languageCode == locale.languageCode }) {
7
+ locales.append(locale)
8
+ }
9
+ }.sorted(by: { $0.languageName < $1.languageName })
10
11
12
+ var languageName: String {
13
+ localizedString(forLanguageCode: languageCode ?? "") ?? ""
14
15
+}
0 commit comments