I have a language code, such as "en_US", and I'm trying to get a friendly name from it such as "English".
Here's what I'm doing right now:
Locale.current.localizedString(forLanguageCode: code)
It works, but for languages such as Chinese, it doesn't quite do what I want.
zh-Hans
should return "Simplified Chinese", and zh-Hant
should return "Traditional Chinese".
However, they both just return "Chinese". How would you get them to return the correct values?
localizedString(forIdentifier:)
function ofLocale
is the more Swiftier way. – Hirsutism