determineLanguageByHeader

Determines a language code from the value of a header string.

  1. string determineLanguageByHeader(string accept_language, T allowed_languages)
    @safe pure @nogc
    string
    determineLanguageByHeader
    (
    T
    )
    if (
    isForwardRange!T &&
    is(ElementType!T : string)
    ||
    is(T == typeof(only()))
    )
  2. string determineLanguageByHeader(string accept_language, Tuple allowed_languages)
  3. string determineLanguageByHeader(HTTPServerRequest req, T allowed_languages)
  4. string determineLanguageByHeader(HTTPServerRequest req, Tuple allowed_languages)

Return Value

Type: string

The best match from the Accept-Language header for a language. null if there is no supported language.

Meta