Fix language sorting

Sorted by country, rendered by language.
This commit is contained in:
Davide De Rosa 2019-04-26 16:06:51 +02:00
parent 9356e02ea0
commit ebddbe9f4b
2 changed files with 3 additions and 3 deletions

View File

@ -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

View File

@ -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() {