Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to translate Summernote editor

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.

like image 628
zdarsky.peter Avatar asked Oct 21 '15 13:10

zdarsky.peter


1 Answers

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>
like image 88
Pablo Corezzola Avatar answered Oct 18 '22 13:10

Pablo Corezzola