ecamp3 icon indicating copy to clipboard operation
ecamp3 copied to clipboard

api: translate constraint violation messages

Open BacLuc opened this issue 3 years ago • 0 comments

This PR implements #2902

Tasks in this PR:

  • [x] Generate translation key from Constraint class name and expose in payload to frontend
  • [x] Also expose the parameters for this translation to the frontend
  • [x] Translate the messages into all configured locales and expose payload to frontend
  • [x] Test that the frontend receives these translations and the translation key with parameters
  • [x] Use the available translations already provided by symfony for the Constraints provided by symfony
  • [ ] Test support for self defined Translations for self defined Constraints
  • [ ] Test support for self defined Translations for variants like de_CH_scout
  • [ ] Integrate with lokalise
  • [ ] Use Translation in Frontend
  • [ ] Support jsonapi and hydra format
  • [ ] Maybe make support for jsonapi and hydra better by not using subclasses (This is currently the only idea to share the functionality between the formats)

Sure not in this PR, and maybe we don't implement it at all:

  • Translation of 400, 401, 403 and 404 Messages in the api
  • Translation of 50x Messages in the api

Is currently a draft, that you may look at it before everything is implemented.

BacLuc avatar Aug 30 '22 16:08 BacLuc