Skip to content

Challenge Part II: Multiple language support #3

@SF92

Description

@SF92

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions