Try doing something like this:
// get the localized country name (in my case, it's US English)
let englishLocale = Locale.init(identifier: "en_US")
// get the current locale
let currentLocale = Locale.current
var theEnglishName : String? = englishLocale.displayName(forKey: NSLocaleIdentifier, value: currentLocale.localeIdentifier)
if let theEnglishName = theEnglishName
{
let countryName = theEnglishName.sliceFrom("(", to: ")")
print("the localized country name is \(countryName)")
}
with this helper function that I found here:
import Foundation
extension String {
func sliceFrom(start: String, to: String) -> String? {
return (rangeOfString(start)?.endIndex).flatMap { sInd in
(rangeOfString(to, range: sInd..<endIndex)?.startIndex).map { eInd in
substringWithRange(sInd..<eInd)
}
}
}
}
I figured this out by researching into this related question.