other_messages.js 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393
  1. const CateoryObj = {
  2. 'Common': 'Common',
  3. 'System': 'System',
  4. 'Event': 'Event',
  5. 'Show': 'Show',
  6. 'Wifi': 'Wi-Fi',
  7. 'IoT': 'IoT',
  8. 'IoT_OneNet_WeChat': 'WeChat App',
  9. 'IoT_OneNet': 'OneNet',
  10. 'IoT_Blynk': 'Blynk',
  11. 'IoT_TinyWebIO': 'TinyWebIO',
  12. 'IoT_MQTT': 'MQTT',
  13. 'Music': 'Music',
  14. 'Pin': 'Pin',
  15. 'Extend': 'Extend',
  16. 'Neopixel': 'Neopixel',
  17. 'Bluebit': 'Bluebit',
  18. 'Sensor': 'Sensor',
  19. 'Weather': 'Weather',
  20. 'Logic': 'Logic',
  21. 'Loop': 'Loop',
  22. 'Math': 'Math',
  23. 'Text': 'Text',
  24. 'Tuple': 'Tuple',
  25. 'Dictionary': 'Dictionary',
  26. 'List': 'List',
  27. 'Variables': 'Variables',
  28. 'Functions': 'Functions',
  29. 'Advanced': 'Advanced',
  30. 'Set': 'Set',
  31. 'File': 'File',
  32. 'IoTMessage': 'open',
  33. 'Network': 'Network',
  34. 'UART': 'UART',
  35. 'Audio': 'Audio',
  36. 'Radio': 'Radio',
  37. 'Bluetooth': 'Bluetooth',
  38. 'Box': 'cocorobo AI Box',
  39. 'Accelerometer': 'Accelerometer',
  40. 'Button': 'Button',
  41. 'Compass': 'Compass',
  42. 'Image': 'Image',
  43. 'Light': 'Neopixel',
  44. 'LCD': 'LCD',
  45. 'AI_camera': 'Camera',
  46. 'AI_LCD': 'LCD',
  47. 'AI': 'AI',
  48. 'AI_face': 'Face ID',
  49. 'AI_20classid': '20 Class ID',
  50. 'AI_number': 'Number ID',
  51. 'AI_color': 'Color ID'
  52. };
  53. const LanguageObj = {
  54. 'new': 'New',
  55. 'save': 'Save',
  56. 'open': 'Open'
  57. };
  58. const TOOLBOX = {
  59. 'new': {
  60. 'title': 'New',
  61. 'description': 'New project'
  62. },
  63. 'savePyCode': {
  64. 'title': 'Save<br/>Code',
  65. 'description': 'Save your Python code to your computer'
  66. },
  67. 'save': {
  68. 'title': 'Save<br/>Blockly',
  69. 'description': 'Save your Blockly code to your computer'
  70. },
  71. 'load': {
  72. 'title': 'Load<br/>Project',
  73. 'description': 'Load Blockly or Python code into the editor'
  74. },
  75. 'example': {
  76. 'title': 'Program</br/>Example',
  77. 'description': 'Load programming example into the editor'
  78. },
  79. 'blockly': {
  80. 'title': 'To Code',
  81. 'description': 'Switch between blockly mode and code mode'
  82. },
  83. 'restore': {
  84. 'title': 'Burning<br/>Firmware',
  85. 'description': 'Clear all data and burn new firmware'
  86. },
  87. 'updateMicrobit': {
  88. 'title': 'Update<br/>Firmware',
  89. 'description': 'Updating your micro:bit firmware'
  90. },
  91. 'read': {
  92. 'title': 'Read fr.<br/>Board',
  93. 'description': 'Read the last code from the cocorobo board'
  94. },
  95. 'run': {
  96. 'title': 'Debug',
  97. 'description': 'Debug code in real time without writing anything to the board'
  98. },
  99. 'flash': {
  100. 'title': 'Flash &<br/>Run',
  101. 'description': 'Flash Python & Blockly code to the board and trigger the board to restart'
  102. },
  103. 'flashOnlyCode': {
  104. 'title': 'Flash Only Code',
  105. 'description': 'Flash only Python code, without Blockly code'
  106. },
  107. 'flashCustom': {
  108. 'title': 'Flash & Rename',
  109. 'description': 'Flash only Python code and named with a custom filename'
  110. },
  111. 'chart': {
  112. 'title': 'Chart',
  113. 'description': 'Open chart form'
  114. },
  115. 'filemanager': {
  116. 'title': 'File</br/>Manager',
  117. 'description': 'Open board file manager'
  118. },
  119. 'extend': {
  120. 'title': 'Plugin</br/>Manage',
  121. 'description': 'Add a custom plugin'
  122. },
  123. 'login': {
  124. 'login': 'Login',
  125. 'logout': 'Logout'
  126. },
  127. 'help': {
  128. 'title': 'Help'
  129. },
  130. 'update': {
  131. 'title': 'Check Update',
  132. 'description': 'Check for new software versions'
  133. },
  134. 'helpDoc': {
  135. 'title': 'Help Document',
  136. 'description': 'Open the software help in a new window',
  137. 'lib': 'View Library',
  138. 'libdesc': 'View \'CocoRobo.py\' source code description'
  139. },
  140. 'downloadHex': {
  141. 'title': 'Download<br/>Hex',
  142. 'description': 'Download a hex file to flash onto your micro:bit'
  143. },
  144. 'sim': {
  145. 'title': 'Sim',
  146. 'description': 'Run the program on the micro:bit emulation interface'
  147. },
  148. 'microbitDriver': {
  149. 'title': 'Micro:bit USB Driver'
  150. },
  151. 'connect': 'Connect',
  152. 'connect-span': 'Auto Detect',
  153. 'term-break': 'BRK',
  154. 'term-reboot': 'RBT',
  155. 'term-reset': 'RST',
  156. 'CocoRobo': 'cocorobo',
  157. 'CocoRobobox': 'cocorobo AI Box',
  158. 'microbit': 'Micro:bit'
  159. };
  160. const CONFIG = {
  161. 'translate': {
  162. 'code_snippets': {
  163. 'title': 'Code Snippets',
  164. 'description': "Code snippets are short blocks of code to re-use in your own programs. There are snippets for most common things you'll want to do using MicroPython.",
  165. 'instructions': "Select one of the snippets below, or type the snippet's trigger then tap the TAB key.",
  166. 'trigger_heading': 'Trigger',
  167. 'description_heading': 'Description',
  168. 'docs': 'Create a comment to describe your code',
  169. 'wh': 'While some condition is True, keep looping over some code',
  170. 'with': 'Do some stuff with something assigned to a name',
  171. 'cl': 'Create a new class that defines the behaviour of a new type of object',
  172. 'def': 'Define a named function that takes some arguments and optionally add a description',
  173. 'if': 'If some condition is True, do something',
  174. 'ei': 'Else if some other condition is True, do something',
  175. 'el': 'Else do some other thing',
  176. 'for': 'For each item in a collection of items do something with each item',
  177. 'try': 'Try doing something and handle exceptions (errors)'
  178. },
  179. 'share': {
  180. 'title': 'Share Code',
  181. 'instructions': 'Use a password and optional hint (to help you remember the password) to securely create a link to share your code with others.',
  182. 'passphrase': 'Password: ',
  183. 'hint': 'Password hint: ',
  184. 'button': 'Create Link',
  185. 'description': 'This URL points to your code:',
  186. 'shortener': 'This is a short version of the link:'
  187. },
  188. 'decrypt': {
  189. 'title': 'Decrypt Source Code',
  190. 'instructions': 'Enter a password to decrypt the source code.',
  191. 'passphrase': 'Password: ',
  192. 'button': 'Decrypt'
  193. },
  194. 'alerts': {
  195. 'download': 'Safari has a bug that means your work will be downloaded as an un-named file. Please rename it to something ending in .hex. Alternatively, use a browser such as Firefox or Chrome. They do not suffer from this bug.',
  196. 'save': 'Safari has a bug that means your work will be downloaded as an un-named file. Please rename it to something ending in .py. Alternatively, use a browser such as Firefox or Chrome. They do not suffer from this bug.',
  197. 'length': 'Oops! Your script is to long given the limited memory on the device.',
  198. 'snippets': 'Snippets are disabled when blockly is enabled.',
  199. 'loopsleep': 'When your code includes an infinite loop without a sleep() function call. Your code will run much more slowly in this mode.',
  200. 'nomicrobit': 'Microbit related blocks are not available and cannot be simulated.',
  201. 'codemode': 'Cannot save blockly in code mode.',
  202. 'cloud': 'Need login to operate the cloud project.'
  203. },
  204. 'confirms': {
  205. 'quit': "Some of your changes have not been saved. Quit anyway?",
  206. 'blocks': "You have unsaved code. Using blocks will change your code. You may lose your changes. Do you want to continue?",
  207. 'newfile': 'This operation will clear all blocks in the programming area. Do you want to continue?'
  208. },
  209. 'code': {
  210. 'start': "",
  211. 'description': "The code editor is read-only in blockly mode."
  212. },
  213. 'drop': {
  214. 'python': 'Extracted from a Python file',
  215. 'hex': 'Extracted from a hex file',
  216. 'cloud': 'Extracted from cloud',
  217. 'xml': 'Extracted from a xml file'
  218. },
  219. 'messagebar': {
  220. 'title': 'This editor is out of date!',
  221. 'link': 'Click here',
  222. 'instructions': 'To open the latest version.',
  223. 'close': 'Hide'
  224. },
  225. 'load': {
  226. 'title': 'Load Script',
  227. 'titleXml': 'Load Script or XML file',
  228. 'titleblockXml': 'Load: Blockly(*.xml) / Python(*.py)',
  229. 'instructions': 'Drag and drop a .xml or .py file in here to open it.',
  230. 'blockXml': 'Open a xml file',
  231. 'submit': 'Load',
  232. 'toggle-drop': 'Or drag and drop a file',
  233. 'toggle-file': 'Or pick a file'
  234. },
  235. 'restore': {
  236. 'title': 'Burning firmware: select a firmware file(*.bin)',
  237. 'firmware_1': 'cocorobo firmware(' + OFFICE_HARDWARD_DATE + ', ' + OFFICE_HARDWARD_VERSION + ')',
  238. 'firmware_box': 'cocorobo AI Box firmware(' + CocoRoboBOX_HARDWARD_DATE + ', ' + CocoRoboBOX_HARDWARD_VERSION + ')',
  239. 'firmware_m4s': 'Simulate micro:bit for Scratch 3 firmware (Beta)',
  240. 'firmware_2': 'Simulate PicoBoard for Scratch firmware',
  241. 'firmware_3': 'Custom firmware',
  242. 'button': 'Start burning',
  243. 'erase': 'Erase flash',
  244. 'erase_title': 'If the burning is not successful, you can try to erase the firmware before burning.',
  245. 'suggest_restore': 'It is detected that the on-board firmware version is too low. It is recommended to update to the latest official firmware. Is it updated immediately?',
  246. 'suggest_esp32': 'MicroPython runtime environment not detected. It is recommended to update to the latest official firmware. Is it updated immediately?'
  247. },
  248. 'update_microbit': {
  249. 'title': 'Update Micro:bit Firmware',
  250. 'step_1': 'Download the hex file from this page to your computer',
  251. 'step_2': 'Then with the battery pack removed and a USB lead connected to your computer, hold the reset button at the back of the micro:bit and plug the USB lead into the device. You should see a drive appear in your file manager called MAINTENANCE.',
  252. 'step_3': 'Drag and drop the .HEX you downloaded from this page onto the micro:bit and wait for the yellow system LED on the back of the device to stop flashing. When the upgrade is completed, the micro:bit will reset, ejecting itself from the computer and re-appear in normal MICROBIT drive mode.',
  253. 'download': 'Download the latest micro:bit firmware'
  254. },
  255. 'chart': {
  256. 'title': 'Chart',
  257. 'viewFullscreen': 'View in full screen',
  258. 'printChart': 'Exit from full screen',
  259. 'downloadPNG': 'Download PNG image',
  260. 'downloadJPEG': 'Download JPEG image',
  261. 'downloadPDF': 'Download PDF document',
  262. 'downloadSVG': 'Download SVG vector image',
  263. 'downloadCSV': 'Download CSV',
  264. 'downloadXLS': 'Download XLS',
  265. 'viewData': '',
  266. 'openInCloud': ''
  267. },
  268. 'filemanager': {
  269. 'title': 'Onboard File Manager',
  270. 'download-file': 'Download file',
  271. 'rename-file': 'Rename file',
  272. 'delete-file': 'Delete file',
  273. 'upload-file': 'Upload file',
  274. 'load-file': 'Open file',
  275. 'run-file': 'Run file',
  276. 'run_file_limit': 'Can only run *.py file',
  277. 'new-folder': 'New folder',
  278. 'delete-folder': 'Delete folder'
  279. },
  280. 'example': {
  281. 'title': 'Program Example'
  282. },
  283. 'extend': {
  284. 'title': 'Plugin Manage'
  285. },
  286. 'update': {
  287. 'message': 'Found New Version {}',
  288. 'download': 'Download the latest version'
  289. },
  290. 'interface': {
  291. 'clear_all': 'This operation will clear all blocks in the programming area. Do you want to continue?',
  292. 'code_mode': 'To Code',
  293. 'block_mode': 'To Block',
  294. 'on_code_mode': 'Cannot save blockly in code mode.',
  295. 'on_block_mode': 'The code editor is read-only in blockly mode.',
  296. 'custom_bin': 'Please choose custom firmware',
  297. 'no_board': 'Serial connection not detected',
  298. 'empty_code': 'Download the empty code to replace the original code?',
  299. 'xml_too_big': 'The Blockly code size has exceeded 100KB and cannot be written, only the Python code part can be written, Do you want to continue?',
  300. 'no_connect': 'Not connected to the internet!',
  301. 'no_update': 'The current software is the latest version!',
  302. 'enter_filename': 'Please enter a file name :',
  303. 'filename_err': 'The file name is illegal, please re-enter'
  304. },
  305. 'serial': {
  306. 'start_debug': 'Debugging',
  307. 'start_flash': 'Start downloading',
  308. 'programmer_success': 'Burning firmware successed',
  309. 'programmer_failure': 'Burning firmware failed',
  310. 'programmer_prepare': 'To prepare to program the {}',//, press the A button for one second, then release',
  311. 'erase_success': 'Erasing firmware successed',
  312. 'erase_failure': 'Erasing firmware failed',
  313. 'erase_prepare': 'To prepare to erase the firmware, hold down the A key, then press the \'rst\' key on the back of the board, then release the \'rst\' and A keys in sequence.',
  314. 'antivirus_blocking': 'The burning program may be blocked by anti-virus software, please turn off the anti-virus software and try again.',
  315. 'alert_select_file': 'Please select a file.',
  316. 'prompt_rename': 'Rename [{}] to:',
  317. 'alert_extname': 'The new file name must have an extension.',
  318. 'confirm_delete': 'Can\'t recover after deleting, are you sure you want to delete the file [{}]?',
  319. 'alert_upload_limit': 'A maximum of 100KB files can only be uploaded.',
  320. 'confirm_upload': 'Prepare to upload the file [{1}] to the [{2}] directory on the board',
  321. 'prompt_new_folder': 'Create a folder under the selected path, please enter a new folder name:',
  322. 'alert_invalid_folder': 'The folder name is illegal.',
  323. 'alert_root': 'The root folder cannot be deleted.',
  324. 'confirm_delete_folder': 'Are you sure you want to delete the folder [{}]? Note: Non-empty folder cannot be deleted.',
  325. 'alert_load_file': 'Can only open *.py or *.xml file',
  326. 'file_onboard': 'code_in_board',
  327. 'file_onboard_block': 'Blockly code read from the board',
  328. 'file_onboard_code': 'Python code read from the board',
  329. 'alert_try_again': 'The onboard program has not been successfully extracted. Try again?',
  330. 'oserror_261': 'For timer conflicts, press the \'rst\' button on the back of the board and try again.',
  331. 'disconnect': 'Disconnect',
  332. 'connect': 'Connect',
  333. 'no_port': 'Serial connection not detected',
  334. 'flash_success': 'Flash Success',
  335. 'flash_failure': 'There is an error in the flash process, please check the program or try again.',
  336. 'debug_failure': 'There is an error in the debug process, please check the program or try again.',
  337. 'read_file_error': 'Failed to download the file, the possible cause is insufficient memory at runtime, press the \'rst\' button on the back of the board and try again. If it is still unsuccessful, it is recommended to temporarily rename \'main.py\' and restart board to get maximum available memory, before attempting to download.',
  338. 'MemoryError': 'For memory error, press the \'rst\' button on the back of the board and try again.',
  339. 'serial_error': 'Unable to receive serial port data, please press the \'rst\' button on the back of the board.',
  340. 'serial_occupied': 'The serial port may be occupied by other programs.',
  341. 'NoMuVisionSensor': 'The MU library is not referenced correctly, please try the "Download Hex" function.'
  342. },
  343. 'oserror': {
  344. '1': 'Operation not permitted',
  345. '2': 'No such file or directory',
  346. '3': 'No such process',
  347. '4': 'Interrupted system call',
  348. '5': 'I/O error',
  349. '6': 'No such device or address',
  350. '7': 'Argument list too long',
  351. '8': 'Exec format error',
  352. '9': 'Bad file number',
  353. '10': 'No child processes',
  354. '11': 'Try again',
  355. '12': 'Out of memory',
  356. '13': 'Permission denied',
  357. '14': 'Bad address',
  358. '15': 'Block device required',
  359. '16': 'Device or resource busy',
  360. '17': 'File exists',
  361. '18': 'Cross-device link',
  362. '19': 'No such device',
  363. '20': 'Not a directory',
  364. '21': 'Is a directory',
  365. '22': 'Invalid argument',
  366. '23': 'File table overflow',
  367. '24': 'Too many open files',
  368. '25': 'Not a typewriter',
  369. '26': 'Text file busy',
  370. '27': 'File too large',
  371. '28': 'No space left on device',
  372. '29': 'Illegal seek',
  373. '30': 'Read-only file system',
  374. '31': 'Too many links',
  375. '32': 'Broken pipe',
  376. '33': 'Math argument out of domain of func',
  377. '34': 'Math result not representable',
  378. '97': 'Address family not supported by protocol',
  379. '104': 'Connection timed out',
  380. '110': 'Connection timed out',
  381. '115': 'Operation now in progress',
  382. '261': 'For timer conflicts, press the \'rst\' button on the back of the board and try again.'
  383. }
  384. },
  385. 'flags': {
  386. 'blocks': true,
  387. 'snippets': true,
  388. 'share': true
  389. }
  390. };