SponsorBlockServer icon indicating copy to clipboard operation
SponsorBlockServer copied to clipboard

Feature Proposal: Server responses should include a key for translations if accept header is application/json

Open Joe-Dowd opened this issue 5 years ago • 2 comments

Currently, the server responds with plain text English for errors (and without the Accept header should continue to do so for backwards compatibility).

I propose standardising error responses like so:

{
  "status": 403,
  "message": "User is not a VIP."
  "translationKey": "__TranslationKey__"
}

Joe-Dowd avatar Aug 30 '20 20:08 Joe-Dowd

Status should not be needed as that is already handled as part of the response

ajayyy avatar Aug 30 '20 21:08 ajayyy

Seems like the API should provide the translation when using the standard "accept-language" header. The key is only useful if the extension already knows about the error.

NDevTK avatar May 01 '21 00:05 NDevTK