|
|
@@ -76,26 +76,13 @@ enum AppLanguage: CaseIterable {
|
|
|
return .english
|
|
|
}
|
|
|
|
|
|
- /// Settings language picker labels — fixed English names, not localized.
|
|
|
+ /// Settings language picker labels in each language's native form (autonym).
|
|
|
var localizedDisplayName: String {
|
|
|
- switch self {
|
|
|
- case .english:
|
|
|
- return "English"
|
|
|
- case .german:
|
|
|
- return "German"
|
|
|
- case .swedish:
|
|
|
- return "Swedish"
|
|
|
- case .frenchCanada:
|
|
|
- return "French (Canada)"
|
|
|
- case .french:
|
|
|
- return "French"
|
|
|
- case .arabic:
|
|
|
- return "Arabic"
|
|
|
- case .chineseSimplified:
|
|
|
- return "Chinese (Simplified)"
|
|
|
- case .chineseTraditional:
|
|
|
- return "Chinese (Traditional)"
|
|
|
+ let locale = Locale(identifier: localeIdentifier)
|
|
|
+ guard let name = locale.localizedString(forIdentifier: localeIdentifier) else {
|
|
|
+ return localeIdentifier
|
|
|
}
|
|
|
+ return name.capitalized(with: locale)
|
|
|
}
|
|
|
}
|
|
|
|