Skip to content

Commit

Permalink
Merge pull request #4 from graycampbell/bug-fixes
Browse files Browse the repository at this point in the history
Update localized display name locale to improve accuracy
  • Loading branch information
graycampbell committed Oct 3, 2017
2 parents 06e10aa + 79a9620 commit 402dcfe
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion GCCountryPicker/GCCountry.swift
Expand Up @@ -34,7 +34,7 @@ public struct GCCountry {

public init?(countryCode: String) {

if let localizedDisplayName = Locale.current.localizedString(forRegionCode: countryCode) {
if let localizedDisplayName = Locale(identifier: Locale.preferredLanguages.first!).localizedString(forRegionCode: countryCode) {

self.countryCode = countryCode
self.localizedDisplayName = localizedDisplayName
Expand Down
2 changes: 1 addition & 1 deletion GCCountryPickerDemo/ViewController.swift
Expand Up @@ -35,7 +35,7 @@ extension ViewController {

fileprivate func configureNavigationBar() {

self.navigationItem.title = Locale.current.localizedString(forRegionCode: "US")
self.navigationItem.title = GCCountry(countryCode: "US")?.localizedDisplayName
self.navigationItem.rightBarButtonItem = UIBarButtonItem(barButtonSystemItem: .edit, target: self, action: #selector(self.showCountryPicker(barButtonItem:)))
}

Expand Down

0 comments on commit 402dcfe

Please sign in to comment.