tiny mce style_formats title

一笑奈何 提交于 2019-12-10 20:57:50

问题


i'm using tinymce style_formats like this:

style_formats : [
                {title : '20px', selector : 'p,div,h1,h2,h3,h4,h5,h6', styles: {lineHeight: '20px'}},
                {title : '25px', selector : 'p,div,h1,h2,h3,h4,h5,h6', styles: {lineHeight: '25px'}},
                {title : '30px', selector : 'p,div,h1,h2,h3,h4,h5,h6', styles: {lineHeight: '30px'}},
                {title : '35px', selector : 'p,div,h1,h2,h3,h4,h5,h6', styles: {lineHeight: '35px'}},
                {title : '40px', selector : 'p,div,h1,h2,h3,h4,h5,h6', styles: {lineHeight: '40px'}},
                {title : '45px', selector : 'p,div,h1,h2,h3,h4,h5,h6', styles: {lineHeight: '45px'}},
                {title : '50px', selector : 'p,div,h1,h2,h3,h4,h5,h6', styles: {lineHeight: '50px'}},
                {title : '55px', selector : 'p,div,h1,h2,h3,h4,h5,h6', styles: {lineHeight: '55px'}},
                {title : '60px', selector : 'p,div,h1,h2,h3,h4,h5,h6', styles: {lineHeight: '60px'}},
                {title : '65px', selector : 'p,div,h1,h2,h3,h4,h5,h6', styles: {lineHeight: '65px'}},
                {title : '70px', selector : 'p,div,h1,h2,h3,h4,h5,h6', styles: {lineHeight: '70px'}},
                {title : '75px', selector : 'p,div,h1,h2,h3,h4,h5,h6', styles: {lineHeight: '75px'}}
        ]
    });

The title of the listbox is "Styles" i want to change it to "Line Height".

Where I need to change? I can't find it in the lang files.

Thanks


回答1:


Open tinymce-->themes-->advanced-->lang-->en.js

Change "style_select":"Styles" to "style_select":"Line Height"

Hope it helps!!

NOTE: You will have to keep this change in mind whenever you update tinymce to a new version




回答2:


To change the title can modify the lang files under tiny_mce/themes/advanced/langs/en.js like "Display Name" described.

But to avoid to have to modify this file everytime you update to a new tinymce version you may change the title using the oninit and setup tinymce configuration parameter in tinymce.init:

tinymce.EditorManager.i18n['en.advanced.style_select'] = 'Line Height';

So, you could use:

tinyMCE.init({
   ...
   setup : function(ed) {
     ed.onBeforeRenderUI.add(function(ed, cm) {
         tinymce.EditorManager.i18n['en.advanced.style_select'] = 'Line Height';
     });
   }
});


来源:https://stackoverflow.com/questions/13922136/tiny-mce-style-formats-title

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!