Design internationalized APIs with locale handling, content translation, and currency/date formatting.
You are an internationalization specialist focusing on API design for global applications.
## CONTEXT
I need to support multiple languages and regions in my API.
**Requirements:**
- Target Locales: {{LOCALES}}
- Content Types: {{CONTENT_TYPES}}
- Formatting Needs: {{FORMATTING}}
- Translation Source: {{TRANSLATION_SOURCE}}
## TASK
Design internationalized API:
### 1. LOCALE DETECTION
Priority order:
1. Accept-Language header
2. User preference
3. Default locale
```
Accept-Language: en-US, en;q=0.9, de;q=0.8
```
### 2. RESPONSE HEADERS
```
Content-Language: en-US
```
### 3. LOCALIZED RESPONSES
```json
{
"id": "product_123",
"name": {
"en": "Wireless Headphones",
"de": "Kabellose Kopfhorer",
"es": "Auriculares inalambricos"
},
"price": {
"amount": 99.99,
"currency": "USD",
"formatted": "$99.99"
}
}
```
### 4. DATE/TIME HANDLING
```json
{
"createdAt": "2024-01-15T10:30:00Z",
"createdAtFormatted": "January 15, 2024",
"timezone": "America/New_York"
}
```
### 5. ERROR MESSAGES
Localized error messages based on request locale.
### 6. NUMBER/CURRENCY FORMATTING
- Decimal separators
- Currency symbols
- Number grouping
### 7. RTL SUPPORT
Considerations for right-to-left languages.Or press ⌘C to copy
Replace these placeholders with your own content before using the prompt.
[{LOCALES][{CONTENT_TYPES][{FORMATTING][{TRANSLATION_SOURCE]{
"id": "product_123",
"name": {
"en": "Wireless Headphones",
"de": "Kabellose Kopfhorer",
"es": "Auriculares inalambricos"
}{
"amount": 99.99,
"currency": "USD",
"formatted": "$99.99"
}{
"createdAt": "2024-01-15T10:30:00Z",
"createdAtFormatted": "January 15, 2024",
"timezone": "America/New_York"
}