index.html 801 B

123456789101112131415161718192021222324252627282930
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
  5. </head>
  6. <body>
  7. <h2>Monaco Editor Localization Sample</h2>
  8. <div id="container" style="width: 800px; height: 600px; border: 1px solid grey"></div>
  9. <script src="../node_modules/monaco-editor/min/vs/loader.js"></script>
  10. <script>
  11. require.config({ paths: { vs: '../node_modules/monaco-editor/min/vs' } });
  12. require.config({
  13. 'vs/nls': {
  14. availableLanguages: {
  15. '*': 'de'
  16. }
  17. }
  18. });
  19. require(['vs/editor/editor.main'], function () {
  20. var editor = monaco.editor.create(document.getElementById('container'), {
  21. value: ['function x() {', '\tconsole.log("Hello world!");', '}'].join('\n'),
  22. language: 'javascript'
  23. });
  24. });
  25. </script>
  26. </body>
  27. </html>