Esempio n. 1
0
func GetLocale(c Category) locale.Spec {
	for _, varname := range []string{"LC_ALL", c.String(), "LANG"} {
		if val := os.Getenv(varname); val != "" {
			return locale.Spec(val)
		}
	}
	return locale.Spec("C")
}
Esempio n. 2
0
// If the Response has an entity, write it to the given output stream.
func (response Response) writeEntity(w io.Writer) locale.Error {
	if response.encoder == nil {
		return nil
	}
	return response.encoder.Write(w, locale.Spec(response.Headers.Get("Content-Language")))
}