Accept-Language is an HTTP request header that communicates a client’s preferred languages and language variants. APIs can use it to translate human-facing values or error messages while keeping machine-facing properties and codes stable. section 9.7.2 section 9.8.3
Localized transaction categories
A request such as GET /accounts/123/transactions with Accept-Language: fr can return Agence de voyage for a human-readable category label. Accept-Language: fr-CA selects a regional variant, while fr;q=0.9, it;q=0.8, *;q=0.5 expresses language preferences and fallback. English may serve as the default when no preference is supplied. section 9.7.2
Apply the header with these boundaries:
- Translate labels, messages, and other human-facing values; do not translate property names or machine-readable codes. section 9.7.2
- Use the preference for localized error messages and, when necessary, string formatting such as amounts in a PDF response. section 9.7.2 section 9.8.3
