Language preference API
| Endpoint | Purpose |
|---|---|
GET /api/me | Includes preferredLanguage: a BCP 47 tag, or null when the user has not chosen one. |
PUT /api/me/preferences | Saves the signed-in user's language. Body: language (required), from and surface (optional, for telemetry). Returns 200 with preferredLanguage. |
The JSON field is camelCase, like the rest of the API. It is stored in the users.preferred_language column.
Errors
| Status | Meaning |
|---|---|
400 unsupported_language | language is not the tag of an enabled locale. |
| 401 | No valid session. |
Enabled locales: en-US, es-US and ar (Arabic, right-to-left). The language_changed event carries the new locale's direction. A user can only change their own language.