A simple, fun translator that converts plain English into the Star Trek's famous Vulcan language.
This application translates English to the famous Star Trek's Vulcan lamguage using a translator API.
Live demo of the application: https://bharati-vulcan-translator.netlify.app/
- HTML
- CSS
- JavaScript
- DOM Manipulation
- APIs
- Callbacks
- Promises
- Fetch API
- User enters the text to be translated in a
<textarea>
field. - When user clicks the "Translate" button, the event handler associated with button click is invoked.
- The event handler then retrieves the text from the
<textarea>
, and creates afetch()
request to the URL: https://api.funtranslations.com/translate/vulcan.json?text=userText, where userText is the to be translated. - Once the translation is returned as a Response object, it is then converted to an object to retrieve the translation from the key
contents.translated
. - The translation is displayed using a readonly
<textarea>
.
https://api.funtranslations.com/translate/vulcan.json?text=userText
- Callbacks
- Promises
- Fetch API requests
- Handling errors from the API