Skip to content

vikubin/gce-uconn-translate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Google Translate API Example

This is an example site using the Google Cloud Translation API Python SDK

The lab shows students how to initially install the site, but the principals of how it works will need to be expanded upon. I recommend showing the contents of the main.py file and templates/index.html file to students, and using this working example as a starting point to use in their own sites.

The Application

Files

This application uses the following main file structure:

gce-uconn-translate
├─ requirements.txt
├─ app.yaml
├─ main.py
├─ templates
│ ├── index.html

requirements.txt

A list of the required packages for the app

app.yaml

A config file for google app engine

main.py

The main application

templates

HTML used in the app. Only one page is used.

Lab

1

Create a new project (if needed)

photo 1

2

Enable the Cloud Translation API

In the search box at the top of your Google Cloud Console, type in "translate" and select "Cloud Translation API".

On the Cloud Translation API page, click Enable.

3

Download and Deploy the Site

3.a

Start Google Cloud Shell by clicking the cloud shell icon on the top right of your screen.

3.b

Create a Project Folder

mkdir translate

3.c

Enter the Project Folder

cd translate

3.c

Pull the project

git clone https://github.com/philku/gce-uconn-translate.git .

3.c

Deploy the project

gcloud app deploy

You may be asked to select a region for your app. Choose the region closest to you.

You will be verify the details of the deployment. Hit enter.

3.e

Open the site by typing:

gcloud app browse

This should open your site in a new window. If it does not, click on the link.

3.f

You should now be at the site

About

Example of the Cloud Translate Python SDK running in App Engine

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published