Giter Site home page Giter Site logo

gce-uconn-translate's Introduction

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

gce-uconn-translate's People

Contributors

vikubin avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.