fix ids and names for text2speech and speech2text extensions ()

This commit is contained in:
Eric Rosenbaum 2018-09-13 15:44:18 -04:00 committed by GitHub
parent 77284d8117
commit 64a1d3e02b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 19 deletions
src
extension-support
extensions
scratch3_speech2text
scratch3_text2speech

View file

@ -14,7 +14,7 @@ const Scratch3MicroBitBlocks = require('../extensions/scratch3_microbit');
const Scratch3Text2SpeechBlocks = require('../extensions/scratch3_text2speech');
const Scratch3TranslateBlocks = require('../extensions/scratch3_translate');
const Scratch3VideoSensingBlocks = require('../extensions/scratch3_video_sensing');
const Scratch3SpeechBlocks = require('../extensions/scratch3_speech');
const Scratch3Speech2TextBlocks = require('../extensions/scratch3_speech2text');
const Scratch3Ev3Blocks = require('../extensions/scratch3_ev3');
const builtinExtensions = {
@ -25,7 +25,7 @@ const builtinExtensions = {
text2speech: Scratch3Text2SpeechBlocks,
translate: Scratch3TranslateBlocks,
videoSensing: Scratch3VideoSensingBlocks,
speech: Scratch3SpeechBlocks,
speech2text: Scratch3Speech2TextBlocks,
ev3: Scratch3Ev3Blocks
};

View file

@ -45,7 +45,7 @@ const finalResponseTimeoutDurationMs = 3000;
const listenAndWaitBlockTimeoutMs = 10000;
class Scratch3SpeechBlocks {
class Scratch3Speech2TextBlocks {
constructor (runtime) {
/**
* The runtime instantiating this block package.
@ -598,10 +598,10 @@ class Scratch3SpeechBlocks {
*/
getInfo () {
return {
id: 'speech',
id: 'speech2text',
name: formatMessage({
id: 'speech.extensionName',
default: 'Google Speech',
default: 'Speech to Text',
description: 'Name of extension that adds speech recognition blocks. Do Not translate Google.'
}),
menuIconURI: menuIconURI,
@ -685,4 +685,4 @@ class Scratch3SpeechBlocks {
return this._currentUtterance;
}
}
module.exports = Scratch3SpeechBlocks;
module.exports = Scratch3Speech2TextBlocks;

View file

@ -54,7 +54,7 @@ const KITTEN_ID = 'KITTEN';
* Class for the text2speech blocks.
* @constructor
*/
class Scratch3SpeakBlocks {
class Scratch3Text2SpeechBlocks {
constructor (runtime) {
/**
* The runtime instantiating this block package.
@ -156,10 +156,10 @@ class Scratch3SpeakBlocks {
* @private
*/
_getState (target) {
let state = target.getCustomState(Scratch3SpeakBlocks.STATE_KEY);
let state = target.getCustomState(Scratch3Text2SpeechBlocks.STATE_KEY);
if (!state) {
state = Clone.simple(Scratch3SpeakBlocks.DEFAULT_TEXT2SPEECH_STATE);
target.setCustomState(Scratch3SpeakBlocks.STATE_KEY, state);
state = Clone.simple(Scratch3Text2SpeechBlocks.DEFAULT_TEXT2SPEECH_STATE);
target.setCustomState(Scratch3Text2SpeechBlocks.STATE_KEY, state);
}
return state;
}
@ -173,9 +173,9 @@ class Scratch3SpeakBlocks {
*/
_onTargetCreated (newTarget, sourceTarget) {
if (sourceTarget) {
const state = sourceTarget.getCustomState(Scratch3SpeakBlocks.STATE_KEY);
const state = sourceTarget.getCustomState(Scratch3Text2SpeechBlocks.STATE_KEY);
if (state) {
newTarget.setCustomState(Scratch3SpeakBlocks.STATE_KEY, Clone.simple(state));
newTarget.setCustomState(Scratch3Text2SpeechBlocks.STATE_KEY, Clone.simple(state));
}
}
}
@ -186,7 +186,7 @@ class Scratch3SpeakBlocks {
getInfo () {
return {
id: 'text2speech',
name: 'Text-to-Speech',
name: 'Text to Speech',
menuIconURI: '', // @todo Add the final icons.
blockIconURI: '',
blocks: [
@ -352,4 +352,4 @@ class Scratch3SpeakBlocks {
});
}
}
module.exports = Scratch3SpeakBlocks;
module.exports = Scratch3Text2SpeechBlocks;