Future-proof opcode and fix issues with copied comments

This commit is contained in:
Andrew Sliwinski 2018-06-05 18:32:02 -04:00
parent 55b1a794ce
commit bccdef0674

View file

@ -7,19 +7,19 @@ const Cast = require('../../util/cast');
const log = require('../../util/log'); const log = require('../../util/log');
/** /**
* The url of the translate server. * The url of the synthesis server.
* @type {string} * @type {string}
*/ */
const SERVER_HOST = 'https://synthesis-service.scratch.mit.edu'; const SERVER_HOST = 'https://synthesis-service.scratch.mit.edu';
/** /**
* How long to wait in ms before timing out requests to translate server. * How long to wait in ms before timing out requests to synthesis server.
* @type {int} * @type {int}
*/ */
const SERVER_TIMEOUT = 10000; // 10 seconds (chosen arbitrarily). const SERVER_TIMEOUT = 10000; // 10 seconds (chosen arbitrarily).
/** /**
* Class for the translate block in Scratch 3.0. * Class for the synthesis block in Scratch 3.0.
* @constructor * @constructor
*/ */
class Scratch3SpeakBlocks { class Scratch3SpeakBlocks {
@ -33,7 +33,7 @@ class Scratch3SpeakBlocks {
} }
/** /**
* The key to load & store a target's translate state. * The key to load & store a target's synthesis state.
* @return {string} The key. * @return {string} The key.
*/ */
static get STATE_KEY () { static get STATE_KEY () {
@ -51,9 +51,9 @@ class Scratch3SpeakBlocks {
blockIconURI: '', blockIconURI: '',
blocks: [ blocks: [
{ {
opcode: 'speak', opcode: 'speakAndWait',
text: formatMessage({ text: formatMessage({
id: 'speak.speakBlock', id: 'speak.speakAndWaitBlock',
default: 'speak [WORDS]', default: 'speak [WORDS]',
description: 'speak some words' description: 'speak some words'
}), }),
@ -105,7 +105,7 @@ class Scratch3SpeakBlocks {
* @param {object} args Block arguments * @param {object} args Block arguments
* @return {Promise} A promise that resolves after playing the sound * @return {Promise} A promise that resolves after playing the sound
*/ */
speak (args) { speakAndWait (args) {
// Cast input to string // Cast input to string
args.WORDS = Cast.toString(args.WORDS); args.WORDS = Cast.toString(args.WORDS);