微小的mce style_formats标题

时间:2012-12-17 21:02:04

标签: tinymce

我正在使用像这样的tinymce style_formats:

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'}}
        ]
    });

列表框的标题是“样式”我想将其更改为“线高”。

我需要改变的地方?我在lang文件中找不到它。

由于

2 个答案:

答案 0 :(得分:1)

要更改标题,可以修改tiny_mce/themes/advanced/langs/en.js下的lang文件 比如描述的“显示名称”。

但为了避免每次更新到新的tinymce版本时都必须修改此文件,您可以使用tinymce.init中的oninit和setup tinymce配置参数更改标题:

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

所以,你可以使用:

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

答案 1 :(得分:0)

打开 tinymce - >主题 - >高级 - > lang - > en.js

“style_select”:“样式”更改为“style_select”:“行高”

希望它有所帮助!!

注意:每当您将tinymce更新为新版本时,您都必须记住此更改

相关问题