Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Joe-Dowd opened this issue Aug 30, 2020 · 2 comments

Comments

@Joe-Dowd
Copy link
Contributor

Joe-Dowd commented Aug 30, 2020

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 Joe-Dowd changed the title Feature Proposal: Server responses should include a key for translations is accept header is application/json Feature Proposal: Server responses should include a key for translations if accept header is application/json Aug 30, 2020
@ajayyy
Copy link
Owner

ajayyy commented Aug 30, 2020

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

@NDevTK
Copy link
Contributor

NDevTK commented May 1, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants