Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,8 @@ function translate(lang, str) {
// Google Translate API is a paid (but dirt cheap) service. This is my key
// and will be disabled by the time the video is out. To generate your own,
// go here: https://cloud.google.com/translate/v2/getting_started
const apiKey =
'AIzaSyBN-bwtos8sKU6X84wkrdjtCF7uzng6kgQ'
const url =
'https://www.googleapis.com' +
'/language/translate/v2' +
'?key=' + apiKey +
'&source=en' +
'&target=' + lang +
'&q=' + encodeURIComponent(str)
const apiKey = 'AIzaSyBN-bwtos8sKU6X84wkrdjtCF7uzng6kgQ'
const url = `https://www.googleapis.com/language/translate/v2?key=${apiKey}&source=en&target=${lang}&q=${encodeURIComponent(str)`
return fetch(url)
.then(response => response.json())
.then(parsedResponse =>
Expand Down