no-op translate blocks until the API is fixed

it's likely we will have to do some proxying+caching of the API in the future
for now, we just want these blocks to not stall for 10 seconds
This commit is contained in:
Thomas Weber committed 2021-09-05 12:15:25 -05:00
1 parent 21879c0b0e
commit d14d6550af
1 file changed
+3
@@ -247,6 +247,9 @@ class Scratch3TranslateBlocks {
* @return {Promise} - a promise that resolves after the response from the translate server.
*/
getTranslate (args) {
// tw: Temporary hack until translate API is fixed
return Promise.resolve(args.WORDS);
// If the text contains only digits 0-9 and nothing else, return it without
// making a request.
if (/^\d+$/.test(args.WORDS)) return Promise.resolve(args.WORDS);