Michael Karén
1 min readSep 9, 2020

--

Thanks @alejandrobueno1196!

Sorry I don't write Spanish so I hope my answer in English is OK.

I think the easiest solution would be to have a Map object where you have a key and the Spanish translation. Then in the ErrorService you could translate the errors. Either if the error codes are sufficient or if you have to add the whole English phrase to make it unique.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/get

--

--

Michael Karén
Michael Karén

Written by Michael Karén

Frontend Architect • JavaScript Enthusiast • Educative.io Author • ngVikings organizer.

No responses yet