Localization and internationalization
Localization and internationalization (i18n)
All REST APIs should support localized, human-readable messages (success, error, validation). Localization applies only to message strings, never to API contracts or machine-readable fields. If you do not want to be as dynamic, at least make sure to include English readable messages.Request language negotiation
APIs must determine the response language using the standard HTTP request header Accept-Language. The value must follow BCP 47 language tags (RFC 5646). Examples:Language resolution rules (mandatory)
Resolve the response language in this order:- Accept-Language header
- Fallback to default language en
Response language declaration
Return the resolved language via Content-Language.What must be localized
Localize:- message fields in success responses
- message fields in error responses
- Validation error messages
- Human-readable descriptions
- Field names
- JSON keys
- Error keys or error codes
- Enum values
- IDs, UUIDs, technical identifiers