Array

extension Array where Element == Locale

Available where Element == Locale

  • Converts an array of Locale objects to an Accept-Language header value. This method creates a comma-separated string where each locale is represented by its identifier, optionally with a quality (q) value. The first locale is added without a quality value, and subsequent locales are appended with a quality value that decreases by 0.1 for each additional locale.

    Declaration

    Swift

    public func toAcceptLanguage() -> String

    Return Value

    A String formatted as an Accept-Language header value.