Skip to content
This repository has been archived by the owner on May 17, 2019. It is now read-only.
/ translation Public archive

Javascript API to translate text using Google's App Script.

License

Notifications You must be signed in to change notification settings

Electroid/translation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

Translation

Javascript API to translate text using Google's App Script.

Set Up

  • Go to the app script homepage for information on how to use scripts.
  • Insert Code.gs into your project.
  • Deploy as a web application and enjoy free translation.

Request Parameters

  • text The text to be translated.
  • source The source language, auto to automatically detect.
  • targets The target languages, separated by commas.

Response Parameters

  • success Whether or not the translation was successful.
  • error If not successful, the error message.
  • translations If successful, the map of source to the translated text.

Example

Request: 
api.com/translate?text=love&source=en&targets=es,fr,de

Response: 
{
  "success": true,
  "error": null,
  "translations": {
    "es": "amor",
    "fr": "amour",
    "de": "Liebe"
  }
}

Working Example

Click here to view

Future

I hope to create lightweight APIs in other languages (Java, Ruby, Swift, Python). You could help by making a pull request.

About

Javascript API to translate text using Google's App Script.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published