[wp-hackers] TinyMCE editor with no localization strings in WordPress
Carlo Gandolfo
carlo at artilibere.com
Wed Apr 27 13:55:41 UTC 2011
Thanks both I (half) arranged with just a row; after:
wp_enqueue_script('tiny-mce',includes_url('js/tinymce').'/tiny_mce.js','','','',false);
I added:
wp_enqueue_script('tiny-mce-lang',includes_url('js/tinymce').'/langs/wp-langs-en.js','','','',false);
and now it works perfectly with plain english translation.
I'm still working to use Italian localization (as my customer requested).
Another thing I corrected in my script is to hook 'optionsConfigStart' no
more to 'init' but to 'admin_print_scripts', as it cointains just a script
queue.
Thanks a lot, I go further to understand how to use the localized version.
If anyone has a suggestion, it's really welcome.
Thanks,
Carlo
2011/4/27 Leo Baiano <ljunior2005 at gmail.com>
> Partner, Good day! I followed the tips found on the link below developed
> as
> a WordPress plugin and it worked perfectly, see if it can help you.
>
> http://www.keighl.com/2010/01/tinymce-in-wordpress-plugins/
>
> 2011/4/27 SWORD Studios <info at swordstudios.net>
>
> > I've used this before
> > http://wordpress.org/extend/plugins/tinymcecomments/ You should be
> > able to reverse engine it from that plugin
> >
> > On Wed, Apr 27, 2011 at 9:17 AM, Carlo Gandolfo <carlo at artilibere.com
> > >wrote:
> >
> > > 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
> > >
> > > _______________________________________________
> > > wp-hackers mailing list
> > > wp-hackers at lists.automattic.com
> > > http://lists.automattic.com/mailman/listinfo/wp-hackers
> > >
> > >
> >
> >
> > --
> > *Jesse Friedman* Founder / Lead Developer
> > *SWORD Studios* | 508.50.SWORD info at swordstudios.net
> > swordstudios.net @professor <http://twitter.com/professor>
> > _______________________________________________
> > wp-hackers mailing list
> > wp-hackers at lists.automattic.com
> > http://lists.automattic.com/mailman/listinfo/wp-hackers
> >
>
>
>
> --
> Amplexos,
>
> Leo Baiano
> http://www.leobaiano.com
> http://www.blog.ljunior.com
> http://www.mcelebridades.com
> http://www.twitter.com/leobaiano
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>
More information about the wp-hackers
mailing list