• Home
  • About John P.
  • Contact
  • Terms
  • Facebook
  • Google+
  • Instagram
  • LinkedIn
  • Pinterest
  • StumbleUpon
  • Twitter
  • YouTube

One Man's Blog

Specialization is for Insects.

  • 10 Best
  • Art
  • Computing
  • Fun Stuff
  • Gadgets
  • Videos
  • Photography
  • Travel
  • Tutorials
  • Health & Fitness
  • Politics
  • Thoughts
  • Food
  • Reviews
  • 10 Best
  • Art
  • Computing
  • Fun Stuff
  • Gadgets
  • Videos
  • Photography
  • Travel
  • Tutorials
  • Health & Fitness
  • Politics
  • Thoughts
  • Food
  • Reviews
Home / Google Tools / Google Translate Wordpress Plugin

Google Translate WordPress Plugin

John P.

March 25, 2007 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!

Related

Filed Under: Google Tools, Wordpress Tagged With: Google Tools, Plugin, Plugins, Wordpress

About John P.

John P. is a former CEO, former TV Show Host, and currently an unemployed bum. You can find him on Twitter, Facebook and Google+. Feel free to send shoutouts, insults, and praise. Or Money. Money is good.

Comments

  1. Kundan Raj Bhattarai says

    February 21, 2014 at 12:20 pm

    Thanks for sharing the article. Previously I used to go to Google translate and then translate it. Now we have the option at the blog itself which makes it easier. But I found it, that it translates fantastic for some languages but for some languages it is not accurate. Anyway it is better to have something than nothing.

    Thanks and Regards.

  2. Ogi says

    July 29, 2012 at 6:53 am

    Hello John,
    Please, tell me how to change the translation to default “Bulgarian” to X language. When I click for example the German flag it translates from English to German. I am sure in England or US the people can’t understand the origin language of my website.
    It will be of great assistance for me. Thank you in advance,

    Ognian

  3. matias says

    May 23, 2012 at 11:36 am

    I was wondering, what if I wanted to translate from another language that is not english.

    And what could be the reason Im not seeing the flags, but the language names instead

  4. Dorian Jasik says

    October 7, 2011 at 4:30 pm

    It’s in point of fact a great and useful piece of info. I’m happy that you shared this useful information with us. Please stay us up to date like this. Thanks for sharing.

  5. penerjemah tersumpah says

    April 20, 2011 at 9:59 am

    I’ve tried many times, but has not been successful and hard at all, what is wrong. why? thanks for the information

  6. Ismael Lovato says

    March 9, 2011 at 3:59 pm

    Thanks a lot for sharing this with all people you actually understand what you’re talking approximately! Bookmarked. Please additionally talk over with my website =). We can have a hyperlink exchange contract among us!

  7. Peter says

    January 6, 2011 at 10:05 am

    <img src="/wp-content/plugins/google-translate/images/germany.gif" width="22" height="15"

    Did have to remove the slash in the code ref to the flags of this wp plugin now its works fine

    <img src="wp-content/plugins/google-translate/images/germany.gif" width="22" height="15"

  8. Bode says

    December 29, 2010 at 1:03 am

    Hello everyone,
    I have a little problem with translator on my blog and have been receiving numerous comment that they want translator which am finding it a bit diffcuit to get that on my blog since am using http://blog.com if it were to be blogger definitely i wouldnt be having this problem but can anyone help me out how to go about this.

    cheers

    • John P. says

      December 30, 2010 at 11:42 am

      Bode,

      Those are not real comments on your blog. I took a look and they are all automated spam comments. You can’t believe anything they ask, and I doubt you really need a translate plugin at all.

      You need to delete anything that doesn’t look like a real discussion of the topic on which it is posted, especially if it doesn’t have a real user name, etc. Otherwise Google will think you just have a spam link farm on your site and will penalize you.

      Good luck,

      John P.

  9. Nikolova says

    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

  10. Thomas says

    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

  11. Ranjith says

    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. :(

  12. rionur says

    May 22, 2010 at 9:38 am

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

  13. BenBen says

    January 28, 2010 at 2:12 am

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

  14. Kumar says

    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

  15. Ivan says

    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 :-)

  16. Dave Metz says

    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.

  17. John P. says

    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.

  18. Ken Stone says

    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

  19. Matt C says

    June 10, 2009 at 6:36 am

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

  20. constantine says

    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.

  21. Martin says

    April 4, 2009 at 8:10 am

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

  22. juanjo says

    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

  23. Hussein EROL says

    February 3, 2009 at 6:49 pm

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

  24. Juan says

    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?

  25. Kirik says

    December 29, 2008 at 11:15 am

    Please add Ukrainian language to next release!

  26. admadi2008 says

    December 19, 2008 at 11:40 am

    Thanks.
    The pulgin is helping each readers

  27. usenet junkie says

    December 17, 2008 at 1:42 am

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

    Thanks

  28. Eric says

    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.

  29. nirz says

    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

  30. nirz says

    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

  31. Keral Patel says

    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.

  32. ashish choudhary says

    October 14, 2008 at 11:25 am

    nice work thanks

    can you add hindi in this

  33. Klaids says

    October 1, 2008 at 11:41 am

    Great job! Please add latvian language to next release!

  34. Adnan Siddiqi says

    September 28, 2008 at 12:54 pm

    How do I add Arabic option in it?

    thanks

  35. Ecuador Investing says

    September 22, 2008 at 9:41 pm

    Thank you very much. The translation feature works very well. The only change I made was to translate the language names from English into each language. Take a look:

  36. Angel says

    September 6, 2008 at 9:14 am

    Hi and thanks for the great plugin. I was able to install it and it works fine. I just needed to change the source language, as it is only english to *. I have one question for everybody who is familiar with wordpress and google translate. When we install this plugin in our blog, does google index the translated pages?

  37. riger99 says

    May 28, 2008 at 9:06 am

    Google now offers Hindi translation, it’s not in this plugin yet (as of May 28, 2008), but all you have to do is add the Indian flag image to the images folder and then add this line of code, just underneath the Chinese translation:

    <a title="Hindi" rel="nofollow" href="http://translate.google.com/translate?u=&langpair=en%7Chi&hl=en&ie=UTF8"> Hindi

  38. Al at 7P says

    March 7, 2008 at 3:14 pm

    It works – très bien!

  39. gelo says

    March 7, 2008 at 1:32 pm

    I pasted here the solution but it seems the code can’t be properly included . You just need to add two angle brackets together (first the ‘less than’, and after the ‘greater than’) without an space between them, after this:
    ['REQUEST_URI']
    in the third line.

  40. Al at 7P says

    February 27, 2008 at 11:39 pm

    I tried this recommendation, but after I tried to save the changes WordPress inactivated the plugin due to errors. JUst wanted to double-check to see if this indeed is correct?

  41. Thai Spy says

    December 21, 2007 at 10:10 am

    David,

    Find:

    function google_translate($vh) {
    $currenturl = $_SERVER["PHP_SELF"];
    if ( $_SERVER['QUERY_STRING'] '') {
    $currenturl .= "?" . $_SERVER['QUERY_STRING'];
    }

    Replace with:

    function google_translate($vh) {
    $currenturl = $_SERVER["SERVER_NAME'"];
    if ( $_SERVER['REQUEST_URI'] '') {
    $currenturl .= $_SERVER['REQUEST_URI'];
    }

    Good luck.

  42. Sky says

    September 11, 2007 at 9:54 pm

    I implemented your plug-in this afternoon and like it a lot. I wanted to have readers go off to Google to read, rather than trying to integrate the translation into my site ’cause I can’t make WP permalinks work at all, which the other translation plug-ins pretty much require. BTW, the Google translations are really pretty bad, but better than nothing.

    Your plug-in does not work with blogs that are installed in subdirectories because you made the assumption that the icons would be in /wp-content/plugins/google-translate/ which is incorrect if a blog (like mine) isn’t located at the DocRoot of the server. This is probably what “David” (above) was running into.

    If you’ll contact me by email (John) I’ll send you the fixed-up file. It basically requires using the function get_bloginfo(‘wpurl’) to pick up the URL for the installation directory and then dropping that into the SRC= in the code where you inserted the flag icons.

  43. David says

    August 20, 2007 at 1:06 pm

    Sorry, been a dunce. Doesn’t work with permalinks on…

    Any news on this being available?

  44. David says

    August 20, 2007 at 12:51 pm

    I reinstalled my blog to the root so it all runs from http://www.yourinternettravelguide.com/.

    The flags show up but all the links are only ever to the index.php page and never to the page or post I have selected.

    Seem to be so close….

  45. David says

    August 20, 2007 at 7:13 am

    Hi,

    I couldn’t get this working on my blog. I got WP Translate from Scot working though so not sure why it is.

    Tried to use it in a sidebar widget and nothing showed. WP Translate is in an working
    Tried to use it out of the widget area and none of the icons were showing and I found that it had not picked up my full blog URL (it’s in a ‘blog’ subdirectory) but the plugin was looking for all the images in root/wp-content….etc so wonder if that’s why the whole plugin is bust.

    Any advice?

  46. GaLaL MaSTeR says

    August 4, 2007 at 9:47 pm

    Thanks you 4 nice help & nice blog. I have asite under construction on googlepages can i add a hyperlink 4image except 4 html codes because i need add another languages

  47. Hullabaloo says

    July 18, 2007 at 1:48 am

    I don’t know why it is doing this. It seems a little strange to me.

    It does all you say but when I click on ‘Chinese’ or ‘Russian’ I get a large white box in the left top corner and the page never stops loading. All the other languages work normally so I don’t know what is going on. I only get this white box when using firefox (2.0.0.4). I tested it out with IE and the white box never shows up.

  48. William says

    July 12, 2007 at 1:24 pm

    Hi John,
    it works great, just like the other guys over here I am a happy user of this wordpress plugin.
    But could you add in a future version of this plugin more languages like arabic and some other exotic ones?

  49. Simonne says

    June 28, 2007 at 4:18 pm

    This is exactly what I was looking for. I hope it works, as I tried some other solutions which failed.

  50. trakin says

    June 25, 2007 at 9:42 pm

    Thank you John… :) you have been a great help !

  51. John P. says

    June 25, 2007 at 9:30 pm

    Trakin,

    I specifically designed this plugin not to be followed by search engines out of fear of being penalized for having duplicate content. However, it is very easy to change that…

    If you edit the PHP document and delete ALL instance of, rel="nofollow" it will make all the various languages discoverable.

    Have fun! :-)

    John

  52. trakin says

    June 25, 2007 at 9:04 pm

    John….perfect…Works like a charm… Really appreciate all the help you provided….Just wanted to know if you are going to have future versions of this plugin, which will have permalinks…the one that global translator or angshuman’s paid translator plugin has ???
    That would be great….It helps in search Engine traffic. I guess the pages converted via this plugin may not be indexed by google…

  53. John P. says

    June 25, 2007 at 8:46 pm

    Darrin and Trakin,

    I’m sorry you had those problems. It looks like there was a problem with my insert statement. I’m not sure why because I’m certain I’ve tested it properly before and it was working. Furthermore I see nothing wrong with it now…

    Anyway, please use the following to insert the flags into the page, but only after enabling the plugin. For horizontal:
    <?php google_translate(2); ?>

    For vertical:
    <?php google_translate(1); ?>

    Let me know how that turns out for you. In some installations you might need to add some style to your stylesheet and I might need to adjust the plugin a bit for you to get it to look nice. But I’ll wait to hear back before making changes to it.

    John

  54. trakin says

    June 25, 2007 at 1:13 pm

    John…Thanks for your plugin…However, I have the same problem on my blog. Nothing happens…I tried horizontal and vertical layout…did everything that I was supposed to, but nothing seems to be working…not in the sidebar, or header.php or footer. I am not well versed with php…can you help me out here..it must be small tweak that must be needed…Thanks

  55. John P. says

    June 24, 2007 at 11:26 am

    Darrin,

    Can you give me a link to your blog, and also tell me what version of WordPress you are running?

    John

  56. Darrin says

    June 24, 2007 at 5:12 am

    Hi John,

    I downloaded your plugin, but no it doesnt work. There’s nothing on display in my sidebar when I added the code in my sidebar.php file.

    Nope, unfortunately I don’t see any flags. :(

    I’m not using widgets, just adding the php code.

  57. twin says

    June 21, 2007 at 12:54 pm

    Great script, tanks you. I’m trying to implament it in my website – http://www.turnkeyforms.com but I wander why not use follow. Google duplicated content issue?

  58. Chris Palmer says

    June 19, 2007 at 2:52 am

    Hey John P.,

    i would like to thank you so much for this free translation tool, I searched so long for that kind of wordpress plugin but only got commerical ones.
    I immediately set it up on my website http://www.picsandclips.de and it works perfect.
    This is by far one of the best wordpress plugin I`ve ever seen.
    Chris Palmer

@johnpoz on Instagram

johnpoz

Instagram post 2159071784169677252_868291 Ok, what we're gonna do, see, is jack this bitch up so high you need a ladder to get in it. Then put low profile tires on it.

Makes sense.
Instagram post 1651683388997198077_868291 Let them eat turkey... I mean cake.
Instagram post 1594542660127178371_868291 Need I say more?
Instagram post 1586584715854724617_868291 Cleaned my vehicles with @ArmorAllUSA Ultra Shine Wash Wipes. Here's the story! http://onemansblog.com/ultrawipes

#ArmorAll - #Ad - #YeeHaw
Instagram post 1583839624509710481_868291 Tomorrow I'm getting my new forklift from @quality_equipment! Can't wait to start forking stuff. ;-)
Instagram post 1483557512108462059_868291 Aaarrgh! What should I choose?
Instagram post 1332177423181111343_868291 Have I died and gone to heaven?
Instagram post 1315216644179506537_868291 Hard boiled chili quail eggs anyone?
Instagram post 1304017255566633787_868291 I'll take two!
Instagram post 1271354042084454476_868291 This exists.
Instagram post 1269750352793792868_868291 Over two pounds of pizza!
Instagram post 1265414420636594555_868291 Where should I start?
Instagram post 1265385838451322970_868291 Give it a minute. You'll get it...
Instagram post 1240070085028312054_868291 Image for post 1240070085028312054_868291
Instagram post 1219268260050203419_868291 Image for post 1219268260050203419_868291
Instagram post 1215376694143316900_868291 It'll tickle yore innards!
Instagram post 1214775572231844624_868291 Image for post 1214775572231844624_868291
Instagram post 1208266011039723853_868291 The @genyhitch is a massive 80 pound drop hitch with a bonus - it can absorb the shock from twists, turns and bumps in the road, providing cushioning for both the tow vehicle and whatever it's pulling.
Instagram post 1204521118366658866_868291 Who's up for some ghost pepper powder in their salt?
Instagram post 1178517226701156973_868291 Downloading at around 140 MB/S.  That's a full Gigabit download speed from the World of Warcraft servers to the new @Acer Predator desktop machine.
Load More... Follow on Instagram
Tweets about johnpoz

Copyright © 2019 · Genesis Framework · WordPress · Log in

Follow Along for E-Mail Updates
Don't miss any of John P's craziness! Just shove your email address in the slot below and we'll take care of the rest! :-)
Arrow

Email: