mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-24 06:52:40 -05:00
Default to a random language
This commit is contained in:
parent
057e89b1e0
commit
3e43786ef6
1 changed files with 9 additions and 1 deletions
|
@ -42,6 +42,14 @@ class Scratch3TranslateBlocks {
|
||||||
return obj;
|
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.
|
* The result from the most recent translation.
|
||||||
* @type {string}
|
* @type {string}
|
||||||
|
@ -102,7 +110,7 @@ class Scratch3TranslateBlocks {
|
||||||
LANGUAGE: {
|
LANGUAGE: {
|
||||||
type: ArgumentType.STRING,
|
type: ArgumentType.STRING,
|
||||||
menu: 'languages',
|
menu: 'languages',
|
||||||
defaultValue: this._viewerLanguageCode
|
defaultValue: this._randomLanguageCode
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue