Search code examples
javascripttinymce

how to change the name of tinymce menubar items


I'm trying to rename items in a menubar in tinyMce Editor so I can translate them. I managed to change her title, but not the sub-items like undo or redo.

tinymce.init({
 selector: 'textarea',  // change this value according to your HTML
 menu: {
   file: {title: 'Arquivo', items: 'newdocument'},
   edit: {title: 'Editar', items: 'undo redo | cut copy paste pastetext | selectall'},
   insert: {title: 'Inserir', items: 'link media | template hr'},
   view: {title: 'Visualizar', items: 'visualaid'},
   format: {title: 'Formatar', items: 'bold italic underline strikethrough superscript subscript | formats | removeformat'},
   table: {title: 'Tabela', items: 'inserttable tableprops deletetable | cell row column'},
   tools: {title: 'Ferramentas', items: 'spellchecker code'}
 }
});

If anyone knows what to do it would be of great help.


Solution

  • TinyMCE is already localized into a large number of languages including Spanish so you don't need to do this manually.

    Assuming you have the correct language pack downloaded and deployed into the correct place you simply need to tell TinyMCE to use that language pack:

    tinymce.init({
      selector: 'textarea',  // change this value according to your HTML
      language: 'es'
    });