Get better country and subdivision names
This commit is contained in:
parent
001477de61
commit
dc5b82b59a
|
@ -75,7 +75,7 @@ func GetChatFlagEmoji(r *http.Request) (string, error) {
|
|||
var flags = []string{}
|
||||
|
||||
// The country. Name or ISO code?
|
||||
if name, ok := city.Country.Names[city.Country.IsoCode]; ok {
|
||||
if name, ok := city.Country.Names["en"]; ok {
|
||||
flags = append(flags, name)
|
||||
} else {
|
||||
flags = append(flags, city.Country.IsoCode)
|
||||
|
@ -85,7 +85,7 @@ func GetChatFlagEmoji(r *http.Request) (string, error) {
|
|||
if len(city.Subdivisions) > 0 {
|
||||
for _, sub := range city.Subdivisions {
|
||||
// Can we get its name?
|
||||
if name, ok := sub.Names[sub.IsoCode]; ok {
|
||||
if name, ok := sub.Names["en"]; ok {
|
||||
flags = append(flags, name)
|
||||
} else {
|
||||
flags = append(flags, sub.IsoCode)
|
||||
|
|
Loading…
Reference in New Issue
Block a user