Skip to content

Commit

Permalink
Update index.js
Browse files Browse the repository at this point in the history
Updates index.js to add in vitalets' suggestion (allows for the tld variable to be passed to the token side of things)
  • Loading branch information
rawr51919 authored Mar 14, 2019
1 parent 1bfad3b commit 5a242d4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ function translate(text, opts) {

opts.from = languages.getCode(opts.from);
opts.to = languages.getCode(opts.to);
opts.tld = opts.tls || 'com';

return token.get(text).then(function (token) {
opts.tld = opts.tls || 'com';
return token.get(opts, text).then(function (token) {
var url = 'https://translate.google.' + opts.tld + '/translate_a/single';
var data = {
client: opts.client || 't',
Expand Down

0 comments on commit 5a242d4

Please sign in to comment.