Get better country and subdivision names

face-detect
Noah Petherbridge 2023-08-15 21:08:07 -07:00
parent 001477de61
commit dc5b82b59a
1 changed files with 2 additions and 2 deletions

View File

@ -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)