Back to Expressjs

Req AcceptsLanguages

_includes/api/en/5x/req-acceptsLanguages.md

latest726 B
Original Source
<h3 id='req.acceptsLanguages'>req.acceptsLanguages([lang, ...])</h3>

Returns the first accepted language of the specified languages, based on the request's Accept-Language HTTP header field. If none of the specified languages is accepted, returns false.

If no lang argument is given, then req.acceptsLanguages() returns all languages from the HTTP Accept-Language header as an Array.

For more information, or if you have issues or concerns, see accepts.

Express (5.x) source: request.js line 172

Accepts (2.0) source: index.js line 195