determineLanguageByHeader

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

  1. string determineLanguageByHeader(string accept_language, T allowed_languages)
  2. string determineLanguageByHeader(string accept_language, Tuple allowed_languages)
  3. string determineLanguageByHeader(HTTPServerRequest req, T allowed_languages)
    @safe pure
    string
    determineLanguageByHeader
    (
    T
    )
    (
    HTTPServerRequest req
    ,)
    if (
    isForwardRange!T &&
    is(ElementType!T : string)
    ||
    is(T == typeof(only()))
    )
  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