Simple package to determine best locale based on a proper Accept-Language
header.
go get github.com/swhite24/go-locale/locale
package main
import(
"github.com/swhite24/go-locale/locale"
)
func main() {
// Pass a proper accept-language header
ls := locale.Read("en-US,en;q=0.8")
// Ask which is best
l := ls.Best()
fmt.Println(l)
// Prints:
// en_US
}
Add support for determining best based on a list of supported locale definitions.