From b65db8d42fbbe88de83c0ccc3e69cff5ee5802c1 Mon Sep 17 00:00:00 2001 From: Davide De Rosa Date: Sat, 13 Apr 2019 18:51:54 +0200 Subject: [PATCH] Use translation language, not country --- Passepartout-iOS/Scenes/About/CreditsViewController.swift | 2 +- Passepartout/Sources/Utils.swift | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Passepartout-iOS/Scenes/About/CreditsViewController.swift b/Passepartout-iOS/Scenes/About/CreditsViewController.swift index 393a9e88..a6591d2a 100644 --- a/Passepartout-iOS/Scenes/About/CreditsViewController.swift +++ b/Passepartout-iOS/Scenes/About/CreditsViewController.swift @@ -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 diff --git a/Passepartout/Sources/Utils.swift b/Passepartout/Sources/Utils.swift index 3d8ea261..258ee40c 100644 --- a/Passepartout/Sources/Utils.swift +++ b/Passepartout/Sources/Utils.swift @@ -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() { } }