How to translate Summernote editor

zdarsky.peter picture zdarsky.peter · Oct 21, 2015 · Viewed 12.3k times · Source

I found that Summernote plugin, has a lot of js files with translations. But how to apply them? I already included them to my page.

Answer

Pablo Corezzola picture Pablo Corezzola · Oct 1, 2016

Example:

File #1 (js) Save as "summernote-ES.js" :

  (function ($) {
  $.extend($.summernote.lang, {
    'es-ES': {
      font: {
        bold: 'Negrita',

bla, bla, bla (this file has 150 lines) file complete

File #2 (html) index.html:

<link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/codemirror/3.20.0/codemirror.css">
<link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/codemirror/3.20.0/theme/monokai.css">
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/codemirror/3.20.0/codemirror.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/codemirror/3.20.0/mode/xml/xml.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/codemirror/2.36.0/formatting.js"></script>

<!-- include summernote css/js-->
<link href="summernote.css">
<script src="summernote.js"></script>
<script src="[your-url]/summernote-ES.js"></script>

<script>
  $(document).ready(function(){
    $('.summernote').summernote({ lang: 'es-ES' }); 
  })
</script>