english.js 670 B

123456789101112131415161718192021222324
  1. /**
  2. * An object for handling the conversion of Python to an English transliteration.
  3. * Currently dummied out, but we will bring this feature back.
  4. *
  5. * @constructor
  6. * @this {BlockPyEnglish}
  7. * @param {Object} main - The main BlockPy instance
  8. */
  9. function BlockPyEnglish(main) {
  10. this.main = main;
  11. }
  12. /**
  13. * A method for opening a dialog with the english transliteration.
  14. */
  15. BlockPyEnglish.prototype.openDialog = function() {
  16. try {
  17. body = Blockly.Pseudo.workspaceToCode();
  18. } catch (e) {
  19. console.error(e);
  20. body = "I couldn't understand the code. Sorry!"
  21. }
  22. this.main.components.dialog.show("English", body, function() {});
  23. }