Use translation language, not country

This commit is contained in:
Davide De Rosa 2019-04-13 18:51:54 +02:00
parent b6d7655b6d
commit b65db8d42f
2 changed files with 5 additions and 1 deletions

View File

@ -137,7 +137,7 @@ extension CreditsViewController {
guard let author = AppConstants.Translations.authorByLanguage[lang] else {
fatalError("Author not found for language \(lang)")
}
cell.leftText = Utils.localizedCountry(lang)
cell.leftText = Utils.localizedLanguage(lang)
cell.rightText = author
cell.accessoryType = .none
cell.isTappable = false

View File

@ -138,6 +138,10 @@ public class Utils {
return String(format: format, locale: Locale.current)
}
public static func localizedLanguage(_ code: String) -> String? {
return Locale.current.localizedString(forLanguageCode: code)
}
private init() {
}
}