code: func ResolveAcceptLanguage(req *Request) AcceptLanguages {
  	header := req.Header.Get("Accept-Language")
  	if header == "" {
  		return req.AcceptLanguages
  	}
  
  	acceptLanguageHeaderValues := strings.Split(header, ",")
  	acceptLanguages := make(AcceptLanguages, len(acceptLanguageHeaderValues))
  
  	for i, languageRange := range acceptLanguageHeaderValues {
  		if qualifiedRange := strings.Split(languageRange, ";q="); len(qualifiedRange) == 2 {
  			quality, err := strconv.ParseFloat(qualifiedRange[1], 32)
  			if err != nil {
  				httpLog.Warn("Detected malformed Accept-Language header quality in  assuming quality is 1", "languageRange", languageRange)
  				acceptLanguages[i] = AcceptLanguage{qualifiedRange[0], 1}
  			} else {
  				acceptLanguages[i] = AcceptLanguage{qualifiedRange[0], float32(quality)}
  			}
  		} else {
  			acceptLanguages[i] = AcceptLanguage{languageRange, 1}
  		}
  	}
  
  	sort.Sort(acceptLanguages)
  	return acceptLanguages
  }
docs: // ResolveAcceptLanguage returns a sorted list of Accept-Language
  // header values.
  //
  // The results are sorted using the quality defined in the header for each
  // language range with the most qualified language range as the first
  // element in the slice.
  //
  // See the HTTP header fields specification
  // (http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.4) for more details.