laminas-api-tools / api-tools-api-problem

Laminas Module providing API-Problem assets and rendering
https://api-tools.getlaminas.org/documentation
BSD 3-Clause "New" or "Revised" License
8 stars 18 forks source link

API Problem translation based on Accept-Language? #3

Closed weierophinney closed 2 years ago

weierophinney commented 4 years ago

I was wondering, would it make sense for apigiliy and api-problem in general to support a translator service, so as to translate all messages in the ApiProblem response based on the Accept-Language HTTP header?

This way in theory a multilingual rest client could get different error messages per language set in the request.

What do you think is the best way to go about it?


Originally posted by @twmobius at https://github.com/zfcampus/zf-api-problem/issues/40

FXLima commented 2 years ago

I'm using https://docs.laminas.dev/laminas-i18n/translation/ I capture Accept-Language in the HTTP header and go through the Translate routines.

Ocramius commented 2 years ago

Closing here, IMO answered perfectly by @FXLima