TinyMCE更改语言

时间:2012-11-07 11:22:52

标签: php javascript tinymce

Goodmoring,

今天我已经在我定制的CMS上安装了TinyMCE。 现在我想将语言改为荷兰语,我的整个tinyMCE文本框将消失。

我已将荷兰语文件上传到TinyMCE指定的位置。当我不添加语言:“nl”时,在我的TinyMCE javascript上行它会起作用(语言是英语)。但是当我添加该行时,整个文本框将从我的页面中消失。

这是我的代码

 <script type="text/javascript" src="jscripts/tiny_mce/jquery.tinymce.js"></script>
    <script type="text/javascript">
        $().ready(function() {
            $('textarea.tinymce').tinymce({

                // Location of TinyMCE script
                script_url : 'jscripts/tiny_mce/tiny_mce.js',

                // General options
                theme : "advanced",

                relative_urls : false,
                plugins : "youtubeIframe,jbimages,autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,images,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,advlist,jbimages",

                // Theme options
                theme_advanced_buttons1 : "code,preview,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,formatselect",
                theme_advanced_buttons2 : "cut,copy,paste,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,|,insertdate,inserttime",
                theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,iespell,youtubeIframe,jbimages,advhr,|,print,|,ltr,rtl,|,fullscreen",


                //COMPLETE LIJST VAN FUNCTIES
                //theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
                //theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
                //theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
                //theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak",



                theme_advanced_toolbar_location : "top",
                theme_advanced_toolbar_align : "left",
                theme_advanced_statusbar_location : "bottom",
                theme_advanced_resizing : true,
                language : "nl",
                // Example content CSS (should be your site CSS)
                content_css : "css/style.css",

                // Drop lists for link/image/media/template dialogs
                template_external_list_url : "lists/template_list.js",
                external_link_list_url : "lists/link_list.js",
                external_image_list_url : "lists/image_list.js",
                media_external_list_url : "lists/media_list.js",

                // Replace values for the template plugin
                template_replace_values : {
                    username : "Some User",
                    staffid : "991234",
                width : "858"
                }
            });
        });
    </script>
    <!-- /TinyMCE -->

我试图将线放在其他地方,但没有任何帮助。

有没有人想解决这个问题,我真的需要荷兰语。

PS。我正在使用TinyMCE的jQuery版本

不,我试图将nl文件重命名为en.js,更改了文件内的2个字母。但现在什么都没有出现。我现在唯一看到的是print.print_desc,而不是打印或打印。

2 个答案:

答案 0 :(得分:1)

1-从此处下载您的语言包:https://www.tiny.cloud/get-tiny/language-packages/
2-使sur在路径yourProject/public/assets/js/langs/yourLangagePack.js中解压软件包 (如果不存在,请添加文件夹...)
3-这样初始化tinyMce

 tinymce.init({
            selector: '#your_textArea_id',
            language: "fr_FR", // french for example ...
            // other options ...
            height: "1000"
        });

ps:写下网站波纹管中提到的语言缩写(例如:en不是engfr_FR不仅是fr

答案 1 :(得分:0)

您必须通过tinyMCE.init初始化语言包,如下所示:

<html>
<head>
</head>
<body>
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript">
    google.load("jquery", "1.4");
</script>
<script type="text/javascript" src="tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
tinyMCE.init({
    mode : "specific_textareas",
    editor_selector: "editor", 
    theme : "advanced",
    language : 'nl',
});
</script>

<textarea class="editor">
</textarea>

</body>
</html>

tinyMCE.init在tiny_mce.js中定义,它与&#34; tinymce \ jscripts \ tiny_mce&#34;中的下载捆绑在一起。据我所知,语言包不能用于jQuery版本的tinyMCE。