---
title: accept.language_lookup
summary: null
url: >-
  https://www.fastly.com/documentation/reference/vcl/functions/content-negotiation/accept-language-lookup
---

```
STRING accept.language_lookup(STRING requested_languages, STRING default, STRING accept_header)
```

**Available in:** all subroutines

Selects the best match from a string in the format of an `Accept-Language` 
header's value in the listed languages using the algorithm described in 
[RFC 4647](https://tools.ietf.org/html/rfc4647), Section 3.4.

This function takes the following parameters:

1. a colon-separated list of languages available for the resource,
2. a fallback return value,
3. a string representing an `Accept-Language` header's value.

This function conforms to [RFC 4647](https://tools.ietf.org/html/rfc4647).

## Example

```vcl
set bereq.http.Accept-Language =
  accept.language_lookup("en:de:fr:nl", "en",
    req.http.Accept-Language);
```
