[go: nahoru, domu]

Skip to content

Commit

Permalink
Added Test URL for testConnection()
Browse files Browse the repository at this point in the history
  • Loading branch information
SerChirag committed Jul 27, 2018
1 parent 055bd30 commit 1db2d20
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/scripts/mtw.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export class ContentScript {
cwHandle.getCommonWords()
.then((cwList) => {
var translator = this.getTranslator();
testConnection(translator.url);
testConnection(translator.testurl);
translator.getTranslations(cwList)
.then((tMap) => {
this.cwMap = tMap;
Expand Down Expand Up @@ -123,7 +123,7 @@ export class ContentScript {
}
}
var translator = this.getTranslator();
testConnection(translator.url);
testConnection(translator.testurl);
translator.getTranslations(cwNotMatch)
.then((tMap) => {
this.processTranslations(tMap, this.userDefinedTranslations, cwMatch);
Expand Down
1 change: 1 addition & 0 deletions lib/scripts/services/googleTranslate.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export class GoogleTranslate {
this.srcLang = srcLang;
this.targetLang = targetLang;
this.url = 'https://www.googleapis.com/language/translate/v2?key=' + this.key;
this.testurl = 'https://www.googleapis.com/language/translate/v2?key=' + this.key + '&source=' + this.srcLang + '&target=' + this.targetLang + '&q=';
}

/**
Expand Down
1 change: 1 addition & 0 deletions lib/scripts/services/yandexTranslate.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export class YandexTranslate {
this.srcLang = srcLang;
this.targetLang = targetLang;
this.url = 'https://translate.yandex.net/api/v1.5/tr.json/translate?key=' + this.key;
this.testurl = 'https://translate.yandex.net/api/v1.5/tr.json/translate?key=' + this.key + '&lang=' + this.srcLang + '-' + this.targetLang + '&text=';
}

/**
Expand Down

0 comments on commit 1db2d20

Please sign in to comment.