-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Multiple Languages
As a user I should be able to request for a joke in my native language. I would like to be able to call:
/random-joke/?count=5&language=lithuanian
And recieve 5 jokes back in lithiuanian.
They dont have to make sense as I guess much humour will be lost between laguages but it will be an interesting (and probably funny) feature to implement.
This will involve fetching the joke; sending the text to a third party translation API which should return the translated text; handling that response then returning the text back to the client.
I did some very quick research and saw IBM have a translate api which has a free tier for your first 1 million characters so that could be worth a look. link here.
Advice:
Don't worry about the actual translation until the end. To behin with focus on:
- validation - which languages will you accept and how will you validate them
- decide a sensible place for the translation logic will live
- create a dummy function to run in place of the translation api
- Implement a call to the translation api instead of your dummy function.