Fix language sorting
Sorted by country, rendered by language.
This commit is contained in:
parent
9356e02ea0
commit
ebddbe9f4b
|
@ -32,7 +32,7 @@ class CreditsViewController: UITableViewController, TableModelHost {
|
|||
private let notices = AppConstants.Notice.all
|
||||
|
||||
private let languages = AppConstants.Translations.authorByLanguage.keys.sorted {
|
||||
return Utils.localizedCountry($0) < Utils.localizedCountry($1)
|
||||
return Utils.localizedLanguage($0) < Utils.localizedLanguage($1)
|
||||
}
|
||||
|
||||
// MARK: TableModelHost
|
||||
|
|
|
@ -137,8 +137,8 @@ public class Utils {
|
|||
return Locale.current.localizedString(forRegionCode: code) ?? code
|
||||
}
|
||||
|
||||
public static func localizedLanguage(_ code: String) -> String? {
|
||||
return Locale.current.localizedString(forLanguageCode: code)
|
||||
public static func localizedLanguage(_ code: String) -> String {
|
||||
return Locale.current.localizedString(forLanguageCode: code) ?? code
|
||||
}
|
||||
|
||||
private init() {
|
||||
|
|
Loading…
Reference in New Issue