forked from CMU-313/cmu-313-f24-nodebb-f24-NodeBB
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Translation backend code with API * Moved translate folder * fix lint * updated test.yaml added back earlier unintentional line deletion * ignore isEnglish and translatedContent for schema tests * fixed lint * Deleted dump.rdb * Update dump.rdb * updated translator api url --------- Co-authored-by: Sarah W. <[email protected]> Co-authored-by: a1inachen <[email protected]> Co-authored-by: Alina Chen <[email protected]>
- Loading branch information
1 parent
be18222
commit bea2bed
Showing
7 changed files
with
37 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
'use strict'; | ||
|
||
const translatorApi = module.exports; | ||
|
||
translatorApi.translate = async function (postData) { | ||
// Edit the translator URL below | ||
const TRANSLATOR_API = 'http://team-bulbasaur-translator-service.azurewebsites.net/'; | ||
const response = await fetch(`${TRANSLATOR_API}/?content=${postData.content}`); | ||
const data = await response.json(); | ||
return [data.is_english, data.translated_content]; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters