Discuss Scratch
- Discussion Forums
- » Advanced Topics
- » Translate Block Source Code
- ispretty
-
100+ posts
Translate Block Source Code
Can anyone tell me where the
translate () to ( v)block's dropdown menu is pulled from in Scratch's source code?
- ispretty
-
100+ posts
Translate Block Source Code
https://github.com/scratchfoundation/scratch-vm/blob/develop/src/extensions/scratch3_translate/index.js#L114-L135I was expecting a list of languages, and I'm not sure what That block is here:
and the menu is a few lines below: https://github.com/scratchfoundation/scratch-vm/blob/develop/src/extensions/scratch3_translate/index.js#L149-L152
this._supportedLanguages
- Pufferfish_Test
-
500+ posts
Translate Block Source Code
The github repo for the scratch-translate-exrension-languages library (which is where the language list comes from) is private, but the source code can be viewed at https://www.npmjs.com/package/scratch-translate-extension-languages?activeTab=code - the language list is in languages.json. The block menu is built from the menuMap property based on the current kanguage so that thr languages are displayed in the user's locale.
- Discussion Forums
- » Advanced Topics
-
» Translate Block Source Code