Skip to content

Commit

Permalink
Merge pull request #3 from shajz/fix.missing.country.iOS-17.4
Browse files Browse the repository at this point in the history
  • Loading branch information
shajz authored Mar 25, 2024
2 parents e001568 + 3dc4ca5 commit 4257e8b
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/ios/GoogleMaps/PluginGeocoder.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,16 @@ - (void)pluginInitialize
{
NSString *identifier = [NSLocale localeIdentifierFromComponents: [NSDictionary dictionaryWithObject: countryCode forKey: NSLocaleCountryCode]];
NSString *country = [[[NSLocale alloc] initWithLocaleIdentifier:currentLanguage] displayNameForKey: NSLocaleIdentifier value: identifier];
[countries addObject: country];
if (country != nil) {
[countries addObject: country];
} else {
NSString *countryFallback = [[[NSLocale alloc] initWithLocaleIdentifier:@"en-US"] displayNameForKey: NSLocaleIdentifier value: identifier];
if (countryFallback != nil) {
[countries addObject: countryFallback];
} else {
[countries addObject: countryCode];
}
}
}

self.codeForCountryDictionary = [[NSDictionary alloc] initWithObjects:countryCodes forKeys:countries];
Expand Down

0 comments on commit 4257e8b

Please sign in to comment.