Skip to content

Using the v2 Google Translate API to translate a web page in the browser.

Notifications You must be signed in to change notification settings

Chicago/Google-Translate-API-Demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Google Translate API Demo

A proof-of-concept for using Google Translate in the browser (without caching translations) for web content.

GIF of translate demo

Motivation

The City of Chicago is developing a web content translation strategy to comply with the 2015 language access ordinance. This repo demonstrates the viability of the Google Translate v2 API for translating web content. This demo uses the AutoML v2 API for simplicity; a city-wide deployment would likely use the new NMT v3 API for greater accuracy.

Next Steps

This demo is a minimal proof-of-concept for web-based translation. A more complete script would scan the DOM for text objects, make one API call containing all text to be translated, and replace all text objects. To ensure translation quality, the script could also send the source text for translation rather than the browser text, as the browser text can be translated back and forth between different languages and get a bit jumbled along the way.

A Note on the Google Translate API

Google does not make it easy to get an API key. I recommend following the Google codelabs tutorial, specifically steps 2-5, to get started.

About

Using the v2 Google Translate API to translate a web page in the browser.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published