Google Translate WordPress Plugin

by John P.

Google Translate Vertical
The Google Translator plugin allows WordPress to add a number of alternate languages to your blog.

This plugin is derived from Scott Hough’s WP Translate, but makes a number of changes:

  • The Google Translate service is used, which does a much better job of maintaining page layout then Babelfish.
  • Height and width attributes are included for all images.
  • ‘rel=nofollow’ has been added to all links to prevent search engines from following them.
  • Alternate text for all images have been improved.
  • The plugin fully validates under XHTML.

Download

Download Google Translate v.3.24.07

Installation

Google Translate should work in all versions of WordPress 1.5 and newer.

  • To install the plugin simply unzip then upload the entire google-translate directory to your plugins folder (/wp-content/plugins/)
  • Activate the plugin within the WordPress Administration Plugins area.

Usage

To add Google Translate to your web page you will need to edit your templates to include the function.

Google Translate

For a horizontal layout add the following:

<?php if(function_exists(‘google_translate’)) google_translate(2); ?>

For a vertical layout add the following:

<?php if(function_exists(‘google_translate’)) google_translate(1); ?>

Use As a Sidebar Widget

If you would rather include the translation in a Widget sidebar you will first need to add a plugin which allows you to execute PHP within the sidebar. I recommend the ExecPHP plugin.

After installation and activation of ExecPHP you can include the Google Translate function within the sidebar Widget area.

License / Warranty

This plugin is distributed freely, just like the original. Feel free to use it, change it to meet your needs, etc. If however you re-distribute it you must include links and reference to Scott Hough and John Pozadzides.

If you find this little widget helps you out and you’d like to return the favor, please provide a link back to One Man’s Blog. Or at least drop me a comment below to let me know it helped out.

Enjoy!


{ 56 comments… read them below or add one }

1 Klaids October 1, 2008 at 11:41 am

Great job! Please add latvian language to next release!

Reply

2 ashish choudhary October 14, 2008 at 11:25 am

nice work thanks

can you add hindi in this

Reply

3 Keral Patel October 30, 2008 at 11:17 pm

Hmmm will this change my existing permalink structure? Because I am much worried about changing the permalink itself.

Reply

4 nirz December 6, 2008 at 3:00 pm

I installed and activated the ExecPHP plugin, added the in the sidebar widget and in the functions.php, but it still does not work. What am i doing wrong?

Thanks for your help

Reply

5 nirz December 6, 2008 at 3:06 pm

Also, I’m getting this error when I activate the translate plugin:
Warning: Cannot modify header information - headers already sent by (output started at /home/indrasuc/public_html/familyofentrepreneurs.com/wp-content/themes/indra/functions.php:30) in /home/indrasuc/public_html/familyofentrepreneurs.com/wp-includes/pluggable.php on line 391

Reply

6 Eric December 12, 2008 at 1:22 pm

Thanks for the explanation, but I’m either too new at this or too dumb to understand your simple instructions about editing “the templates” by adding the following code to include the Google Translate function.

For a horizontal layout add the following:

For a vertical layout add the following:

Where is this added to? On what template? I’ve added the code to the bottom of each of the php template files but nothing appears on any of the pages or within any of the posts.

Appreciate your help. Thanks in advance.

Reply

7 usenet junkie December 17, 2008 at 1:42 am

Thankyou im getting a lot of traffic from non english sites this is brilliant.

Thanks

Reply

8 admadi2008 December 19, 2008 at 11:40 am

Thanks.
The pulgin is helping each readers

Reply

9 Kirik December 29, 2008 at 11:15 am

Please add Ukrainian language to next release!

Reply

10 Juan January 28, 2009 at 1:27 am

I installed the plugin, and updated the templates to include the code

but my blog is not rendering the function. It is like it’s not finding the function.

any ideas?

Reply

11 Hussein EROL February 3, 2009 at 6:49 pm

Google Translate now support Turkish and more few language.
Please update this plugin and support other languages.

Reply

12 juanjo March 11, 2009 at 3:40 pm

where can i paste this line? in wich archive of my template?
php if(function_exists(’google_translate’)) google_translate(2);

thanks

Reply

13 Martin April 4, 2009 at 8:10 am

Thanks for this tidbit, I appreciate you and will be back often….

Reply

14 constantine June 9, 2009 at 9:11 pm

I found your blog on google and read a few of your other posts. I just added you to my Google News Reader. Keep up the good work. Look forward to reading more from you in the future.

Reply

15 Matt C June 10, 2009 at 6:36 am

Yes this is going to help improve my blogs seo as well as worldwide visitors.

Reply

16 Ken Stone August 9, 2009 at 9:02 am

Don’t you think it may be a good idea to tell us non-coding non-programing types a little more about where to paste your text?

I note that others have asked this same question, but have failed to see your response.

Thanks

Ken

Reply

17 John P. August 9, 2009 at 4:03 pm

Ken,

As I said in the post, “you will need to edit your templates to include the function”.

Unfortunately, every single WordPress theme is different. And people will want this in different places on their site. There is no way in the universe for me to tell you how or where specifically to put the code in your theme.

I suggest asking whomever you got your theme from where you can use this code as they should be able to tell you very quickly.

John P.

Reply

18 Dave Metz August 9, 2009 at 5:27 pm

This is far supierior to Babelfish, although I thought Bebelfish was pretty good at the time of its release.
A few more language options would be beneficial. I expect these will gradually be added in due course.
Many thanks for this great tool.

Reply

19 Ivan October 7, 2009 at 3:50 pm

Hey John! Can you explain to me how to install this on the kubrick theme? I need to add the horizontal layout on the top right side of the theme header. Thanks for your consideration :-)

Reply

20 Kumar January 14, 2010 at 2:47 am

hi, i tried to add translator on my blog, but it does not appear, can u pls suggest how to add,? thanks

Reply

21 BenBen January 28, 2010 at 2:12 am

so wonderful. It is like a bridge between different people using different language.

Reply

22 rionur May 22, 2010 at 9:38 am

Wow.. fantastic,,
i will place the Plugin in my WP .hehe

Reply

23 Ranjith July 4, 2010 at 12:09 pm

Hey,

First up, thanks for bringing this translator thing to my notice.

But, doesn’t this work any longer?

I tried it for my site healthburden.com, but my attempts failed. :(

Reply

24 Thomas September 29, 2010 at 10:28 am

thank your plugin.
i have found plugin translate but i dont know which best :(
i am new bie for word press

Reply

25 Nikolova December 16, 2010 at 4:50 pm

I have installed the aforementioned plug-in, most of the translations seem to be quite decent, but it appears to not be localised well, especially in terms of date format, which is different for different countries and other small details, which require further and manual localisation

Reply

Leave a Comment

Previous post:

Next post: