Back to Expressjs

Req AcceptsLanguages

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

latest758 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 (4.x) source: request.js line 179

Accepts (1.3) source: index.js line 195