Skip to content

Commit

Permalink
Update index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
LastSymphony12 authored Nov 13, 2024
1 parent cb4d144 commit efc0d9e
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/translate/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
'use strict';
var request = require('request');

Check failure on line 1 in src/translate/index.js

View workflow job for this annotation

GitHub Actions / lint-and-test / test

Use the global form of 'use strict'

Check failure on line 1 in src/translate/index.js

View workflow job for this annotation

GitHub Actions / lint-and-test / test

Unexpected var, use let or const instead

Check failure on line 1 in src/translate/index.js

View workflow job for this annotation

GitHub Actions / lint-and-test / test

'request' is assigned a value but never used

const translatorApi = module.exports;

translatorApi.translate = async function (postData) {
// Edit the translator URL below
const TRANSLATOR_API = 'https://nodebb-craig-street-chipotle.azurewebsites.net/';
const response = await fetch(TRANSLATOR_API + '/?content=' + postData.content);
const TRANSLATOR_API = "https://nodebb-f24-translator.azurewebsites.net/"
const response = await fetch(TRANSLATOR_API+'/?content='+postData.content);
const data = await response.json();
return [data["is_english"], data["translated_content"]];
};
return [data["is_english"], data["translated_content"]]
}

0 comments on commit efc0d9e

Please sign in to comment.