Google AJAX Translation WordPress Plugin
UPDATE:
Nick Marshall is the lead developer on this plugin now. He has done an awesome job to bring it to a new level! And he moderates the plugin forum actively! Please feel free to post your questions or comments there as well.
UPDATE:
Thanks Michael Klein for his great work on this plugin. We’ve updated to Version 0.3.1 now.
Some changes:
- Encapsulate the plugin in a class. No global vars needed anymore, faster code! (Michael Klein)
- Better support of capabilities-model (WP 2.6)
- Fixed some html-bugs (missing alt-Tags, etc.)
And, please make sure go to your WordPress Settings->Google Translation admin page to reconfig all the preferences after the updating. Thanks!
Google AJAX Translation is my the first WordPress Plugin, it has been downloaded more than 1700 times until today. And because it is so simple, I haven’t done any major update after the first release.
Couple of days ago, I’ve got an email from Michael Klein from alquanto.de. In his email, he attached a updated version of my plugin and show me how it works on his blog: http://groovengine.de
Mr. Michael Klein has finished a big task on my todo list: Switch between flag icon and text for all these languages.

It’s amazing! This is the beauty of Open Source! We need a new update version now!
Say hello to Google AJAX Translation WordPress Plugin 0.2.0!
What’s new?
- Switch between flag icon and text for all these languages. Thanks Mr. Michael Klein!
- Admin configuration page

- Enable/Disable Posts Translation
- Select which languages you want to support
- More Languages Support, it has 23 languages in total:

* Arabic
* Bulgarian New!
* Chinese (Simplified and Traditional)
* Croatian New!
* Czech New!
* Danish New!
* Dutch
* English
* Finnish New!
* French
* German
* Greek
* Hindi New!
* Italian
* Japanese
* Korean
* Norwegian New!
* Polish New!
* Portuguese
* Romanian New!
* Russian
* Spanish
* Swedish New!
How to update?
- Download the newest version from WordPress
- Unzip it and you will have everything in the “google-ajax-translation” folder
- Overwrite the exist “google-ajax-translation” folder on your server, it should be in “wp-content/plugins/” directory
- Active it from your admin page
- Do some changes on Google Ajax Translation admin page
Enjoy!
Please feel free to comment here if you have any questions, or you still can check if is was already answered on the old post.
And it is on GitHub too!

looking cool, will test it soon.
Perhaps , turkish become turning service.
Very impressive.
Good work.
Looks really nice so I tried it, but the html validation shows 17 errors and when I click on a flag or text link nothing happend, so I had to dissable the plugin meanwhile.
I would like to try next version again, so please let me know when it’s ready.
Thks and have a nice day, Helmut
Nice Plugin but I need to remove the Link Border from the flags. Please advise how, as this is not easily seen in the PHP file.
@helmeloh: Maybe you should take a look at the new version… it cleanly validates with w3.org.
Regarding the “clicked-and-nothing-happened”: well, maybe you should activate JavaScript for that, because we’re using the JavaScript-API of Google….
so long,
Michael
Hello. Thanks for this nice plugin, first. Second, the post translation doesn’t work, and I did check the “Enable post translation” option. If I open the article, I can translate the comments, but not the post. Clicking on any flags doesn’t do anything. What could be wrong?
Thank you.
The plugin isn’t working for my browser either (on this page at least).
And my Javascript is on, otherwise it would make my web development job much more interesting to say the least…
Hi Ramon,
Could you please let me know what theme you are using, or you can just open :
…/wp-content/themes/your current theme/footer.php
Try to find if it has
< ?php wp_footer(); ?>
If not, please just add it in before < / body >
Hope this will fix the problem. Let me know if it still doesn’t work.
I’m not using it on my site. I was testing it on yours. It works fine from my home browser, not from work though. not sure why. Maybe the corporate firewall blocks something the api needs?
maybe there is a problem with your content-filtering firewall, because the main js-files come directly from google and not from this site.
Hmm…
Thanks Michael Klein for his great work on this plugin. We’ve updated to Version 0.3.1 now.
Please be sure to check out the newest version!
And, please make sure go to your WordPress Settings->Google Translation admin page to reconfig all the preferences after the updating. Thanks!
Enjoy!
Nice plugin!! Great work!
is it possible to make it translate an entire page and not only comments?
cheers mads
Thank you for your answer above and for cleaning the code. Now there is no HTML error anymore, but I’m sorry to say, it does not work. I just get the error message “google_translate is not defined”.
Cheers Helmeloh
Here it seems to work fine, so maybe I did something wrong. Appreciate your hint.
It’s again me. In the admin panel the translation works fine, but not on my blog.
Hi Helmeloh,
Please take a look on comment #9 or open :
…/wp-content/themes/your current theme/footer.php
Try to find if it has
< ?php wp_footer(); ?>
If not, please just add it in before < / body >
Please give it a try and let me know how it goes.
Thanks
i like it, but would only use it if it could translate my entire site
Google Translate is the one which works better for entire site:
Google Translate
Hi Libin Pan,
Thank you for your help. After inserting it works, but there were still some HTML errors. Now I added in ajaxtranslation.php on
line 232 because the HTML validator should just check the HTML source, but not the JS source and now I’m really happy with the nice translation tool.
Correction at the beginning of the script “”
Thanks helmeloh!
Glad to hear it works for you now. Will fix the HTML validation problem when the next version come out.
Libin
Hey Libin, I’ve installed your awesome plug in on my test blog and it does not stay at the bottom of each post, if i add an image it goes to the side of the post, but when it’s just a text post it stays at the bottom. check it, http://www.miel-da.com/wordpress.
Thank you,
F
Hi Francisco,
Your site looks really nice!
Could you please do a simple change on your theme:
wp-content/themes/wp-andreas01/style.css
On line 59, please remove ‘float:left;’. Then it should work again.
Thanks,
Libin
Thanks my man! it worked. Keep up the good work my friend.
How do I place the translation in a custom spot like in the bottom of the footer , or in the sidebar.
I tried looking for a tag. Could not find it.
How can you change where the plugin is placed within the template ?
Thanks for this tool!!
I have a problem, when I click to translate a text, it translates it but if the post has images or videos, they dissapear. Maybe it is normal…but I don´t think so.
@Rohin:
You can open ajaxtranslation.php and change some codes in processContent and processComment to change the position of the flags or text.
@Giikah:
Before the plugin sends the text to google, it will filter out all the html tags. The reason is google will translate the text inside the html tags for you. We are trying to find a better solution for this issue. So far, if you see images or videos disappear after the translation, it is normal, kind of.
Thanks!
¡Thanks for your fast response!
hi, i really want to use this on my site, is there a way to use it for Posts and Comments, but not Pages.
thanks!
Thanks for sharing this Plugin. Your Blog already Bookmarked
Hey Sam,
I think this is exact what you want, only translate posts or comments, but not pages.
Have you tried to install on your site yet?
Hey buddy, me again, another question, when i translate large amounts of text only half gets translated and the other stays in English. Is there something I’m missing out on?
Thanks man!
Francisco
check the latest post
http://www.miel-da.com/wordpress
Thank you!!!
Hey Francisco,
You didn’t miss anything. There is a limitation in Google AJAX Translation API as it only accepts less than 500 characters. So we only pass the first 500 characters over to Google.
This is a known issue and we are working on it to find a better solution. At the same time, Google says it will release a new version of AJAX Translation API very soon. Hope the coming verion will do better on this.
Anyway, stay tuned!
Libin
@Libin Pan:
yes i installed it, but it the flags are showing up on both posts and pages! would it be something to do with my theme? how can i disable it on pages?
thanks
Hey Sam,
Sorry I’ve misunderstood the ‘Pages’.
Have sent you a updated version which has Enable/Disable Page Translation option, please give it a try.
And I will update the WP svn to the new version with some other changes too. If any one else need this feature right now, please email me.
Thanks,
Libin
@Libin Pan
thanks for the updated version! i tried it out, the page vs post function feature works well, but there is a new problem now, as it seems to have disabled the flag buttons on my category archive list.
on a category list of posts it still displays the text “View this comment in:” its just the flag buttons that are missing. once i click in to the individual post, the flags reappear, but they dont show on the category list.
my WP install is split into 3 very different categories each with their own template. unfortunatley i cant use this plugin without the category feature working properly.
is it a simple fix?
thanks so much
sam
Amazing Plugin. Thanks for Sharing.
I have two WP blogs for myself, and have installed some for our clients. Simple to use, easy enough to modify, definitely a great product. Good Plugins!
thx for the great plugin, it works fine on my website, but how can I change this that it is on the top of post or comment? I have look in the ajaxtranslation.php but I see nothing.
Thanks for this great plugin! I`ve played around with it a bit and found out that the Translation API now obviously allows more characters. After changing the variables the plugin works fine with up to 1355 characters on my blog. Btw – they`ve also announced support for 11 additional languages.
Hi,There has something incorrect in your plugin.
zh_TW’s flag should be R.O.C(Taiwan)’s flag,
Not P.R.C’s flag,
because Traditional Chinese well used in R.O.C(Taiwan),
Not Mainland China.
What can I expect from the plugin when this site shows 329 HTML errors and 29 warnings. Ever heard from a HTML validator?
I spent again a night to find the errors – aahhhh!
Warning: Invalid argument supplied for foreach() in C:\AppServ\www\wordpress\wp-content\plugins\google-ajax-translation\ajaxtranslation.php on line 199
????
on my site: ,The posts can’t be tanslated!
Excellent plug-in. Thank you for share!
Is it possible to disable translation on some posts?
I am getting this error in console after clicking the Flag icon. What could be the reason…
Error: google_translate is not defined
Source File: javascript:google_translate(‘hi’,'post’,14);
Line: 1
Problem help please: The flags won’t show on my website it just shows blank images, but aside from that it works perfectly.
Hey it is only translating the first paragraph ? View it here
http://davidfowlerads.com/uncategorized/test-post-3/
nice plug in