I’m building an online editor where the language is set by the user settings that can be change dynamically with AJAX (page does not reload), so I init the tinyMCE object the first time correctly but after the user try to init it again, the text inside the editor controls has incorrect values (“advanced.bold” instead of “Bold”, advanced.italic_desc instead of “Italic”, etc), but the plugin popups are in the correct language!
Basically my code just do the init method each time the user changes the language in their preferences…
initMCE: function(lang) {
tinyMCE.init({
language : lang,
mode : "textareas",
theme : "advanced",
relative_urls : false,
editor_selector : "tinymce",
plugins : "emotions,spellchecker,advhr,insertdatetime,preview,media,inlinepopups,xhtmlxtras",
// Theme options - button# indicated the row# only
theme_advanced_buttons1 : "fontselect,fontsizeselect,bold,italic,underline,forecolor,|,bullist,numlist,|,blockquote,|,image,|,link,unlink,|,code,spellchecker",
theme_advanced_buttons2 : "",
theme_advanced_buttons3 : "",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "right",
theme_advanced_resizing : true,
content_css : "../_style/_css/style.css",
inline_styles : false
});
}
Any ideas of how to do it or what am I doing wrong?
I reported this as bug on their site and they told me to use a workaround while they fix it (seems the load lang call is just running one time instead inside the init). Using this line after the init, the language change works fine:
Check this fiddle to see it working