Merge pull request #1181 from ericrosenbaum/feature/random-language

Translate block defaults to a random language
This commit is contained in:
Eric Rosenbaum 2018-05-31 12:00:05 -04:00 committed by GitHub
commit 3810227496
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -42,6 +42,14 @@ class Scratch3TranslateBlocks {
return obj;
});
/**
* A randomly selected language code, for use as the default value in the language menu.
* @type {string}
* @private
*/
this._randomLanguageCode = this._supportedLanguages[
Math.floor(Math.random() * this._supportedLanguages.length)].value;
/**
* The result from the most recent translation.
* @type {string}
@ -102,7 +110,7 @@ class Scratch3TranslateBlocks {
LANGUAGE: {
type: ArgumentType.STRING,
menu: 'languages',
defaultValue: this._viewerLanguageCode
defaultValue: this._randomLanguageCode
}
}
},