photoprism/internal/maps/country.go

19 lines
300 B
Go
Raw Normal View History

package maps
import "strings"
// CountryName tries to find a matching country name for a code.
func CountryName(code string) string {
if code == "" {
code = "zz"
} else {
code = strings.ToLower(code)
}
if name, ok := CountryNames[code]; ok {
return name
}
return CountryNames["zz"]
}