[wp-hackers] TinyMCE editor with no localization strings in WordPress

Carlo Gandolfo carlo at artilibere.com
Wed Apr 27 13:17:18 UTC 2011


Hello list,
I've got a problem with the WordPress editor.
I want to include it on a WordPress plugin but I cannot understand how to
load localization strings.
As you can see on the picture below I see the textual placeholder (as
'advanced.underline_desc', 'advanced.fontdefault'...).

Below that's how I coded. Where I was wrong?

Thank you very much,
Carlo

----------------------------
add_action('init', 'optionsConfigStart', 1);
add_action('admin_footer', 'MCEditorReplacer');
...
function optionsConfigStart(){

 wp_enqueue_script('tiny-mce',includes_url('js/tinymce').'/tiny_mce.js','','','',false);
}
...
function MCEditorReplacer(){
include_once(ABSPATH.WPINC.'/js/tinymce/langs/wp-langs.php');
$mce_locale=(''==get_locale())?'en':strtolower(substr(get_locale(),0,2));?>
<script type="text/javascript">
tinyMCE.init({
theme : "advanced",
 mode: "exact",
skin: "wp_theme",
 language: "<?php echo $mce_locale;?>",
plugins : "paste",
 elements : "description_text",
theme_advanced_toolbar_location : "top",
 theme_advanced_buttons1 :
"bold,italic,underline,forecolor,fontselect,fontsizeselect,sub,sup,"
+ "justifyleft,justifycenter,justifyright,justifyfull,",
 theme_advanced_buttons2 : "numlist,bullist,outdent,indent,"
+ "cut,copy,pastetext,undo,redo,"
 + "link,unlink,anchor,hr,charmap,",
theme_advanced_buttons3 : "",
 height:"350px",
width:"740px"
});
</script>
<?php
}#end MCEditorReplacer

----------------------------
Picture attached: http://www.artilibere.net/language.png


More information about the wp-hackers mailing list