Home > English, WordPress > Google AJAX Translation WordPress Plugin

Google AJAX Translation WordPress Plugin

August 4th, 2008

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?

  1. Download the newest version from WordPress
  2. Unzip it and you will have everything in the “google-ajax-translation” folder
  3. Overwrite the exist “google-ajax-translation” folder on your server, it should be in “wp-content/plugins/” directory
  4. Active it from your admin page
  5. 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!

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • LinkedIn
  • Reddit
  • StumbleUpon
  • TwitThis

English, WordPress , , , , , , , ,

  1. hanjra
    August 4th, 2008 at 03:49 | #1

    looking cool, will test it soon.

  2. August 4th, 2008 at 11:04 | #2

    Perhaps , turkish become turning service.
    Very impressive.
    Good work.

  3. August 5th, 2008 at 00:49 | #3

    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

  4. Gareth
    August 8th, 2008 at 04:11 | #4

    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.

  5. August 11th, 2008 at 19:33 | #5

    @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

  6. August 12th, 2008 at 05:12 | #6

    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.

  7. Ramon
    August 12th, 2008 at 09:27 | #7

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

  8. August 12th, 2008 at 09:41 | #8

    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.

  9. Ramon
    August 12th, 2008 at 11:57 | #9

    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?

  10. August 12th, 2008 at 18:35 | #10

    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…

  11. August 12th, 2008 at 22:09 | #11

    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!

  12. August 13th, 2008 at 17:11 | #12

    Nice plugin!! Great work!
    is it possible to make it translate an entire page and not only comments?

    cheers mads

  13. August 19th, 2008 at 00:39 | #13

    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

  14. August 19th, 2008 at 00:42 | #14

    Here it seems to work fine, so maybe I did something wrong. Appreciate your hint.

  15. August 19th, 2008 at 01:28 | #15

    It’s again me. In the admin panel the translation works fine, but not on my blog.

  16. August 19th, 2008 at 09:02 | #16

    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

  17. justin
    August 19th, 2008 at 14:39 | #17

    i like it, but would only use it if it could translate my entire site

  18. August 19th, 2008 at 14:43 | #18

    Google Translate is the one which works better for entire site:

    Google Translate

  19. August 20th, 2008 at 01:20 | #19

    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.

  20. August 20th, 2008 at 01:23 | #20

    Correction at the beginning of the script “”

  21. August 20th, 2008 at 09:44 | #21

    Thanks helmeloh!

    Glad to hear it works for you now. Will fix the HTML validation problem when the next version come out.

    Libin

  22. Francisco
    August 23rd, 2008 at 07:05 | #22

    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

  23. August 23rd, 2008 at 09:13 | #23

    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

  24. Francisco
    August 24th, 2008 at 05:11 | #24

    Thanks my man! it worked. Keep up the good work my friend.

  25. August 30th, 2008 at 22:51 | #25

    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.

  26. August 31st, 2008 at 01:57 | #26

    How can you change where the plugin is placed within the template ?

  27. August 31st, 2008 at 06:36 | #27

    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.

  28. August 31st, 2008 at 11:53 | #28

    @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!

  29. August 31st, 2008 at 11:58 | #29

    ¡Thanks for your fast response!

  30. sam
    September 6th, 2008 at 04:00 | #30

    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!

  31. September 6th, 2008 at 07:37 | #31

    Thanks for sharing this Plugin. Your Blog already Bookmarked :)

  32. September 6th, 2008 at 08:54 | #32

    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?

  33. Francisco
    September 6th, 2008 at 17:44 | #33

    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!!!

  34. September 6th, 2008 at 21:15 | #34

    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

  35. sam
    September 7th, 2008 at 13:45 | #35

    @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

  36. September 8th, 2008 at 00:23 | #36

    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

  37. sam
    September 8th, 2008 at 12:09 | #37

    @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

  38. September 13th, 2008 at 20:26 | #38

    Amazing Plugin. Thanks for Sharing.

  39. September 21st, 2008 at 11:26 | #39

    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!

  40. October 19th, 2008 at 19:05 | #40

    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.

  41. October 25th, 2008 at 04:17 | #41

    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.

  42. October 26th, 2008 at 12:34 | #42

    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.

  43. October 26th, 2008 at 22:34 | #43

    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!

  44. October 28th, 2008 at 20:09 | #44

    Warning: Invalid argument supplied for foreach() in C:\AppServ\www\wordpress\wp-content\plugins\google-ajax-translation\ajaxtranslation.php on line 199

    ????

  45. November 14th, 2008 at 09:48 | #45
  46. Daedal
    November 22nd, 2008 at 07:04 | #46

    Excellent plug-in. Thank you for share!

    Is it possible to disable translation on some posts?

  47. November 22nd, 2008 at 08:47 | #47

    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

  48. tyler
    November 28th, 2008 at 16:46 | #48

    Problem help please: The flags won’t show on my website it just shows blank images, but aside from that it works perfectly.

  49. December 19th, 2008 at 15:17 | #49

    Hey it is only translating the first paragraph ? View it here

    http://davidfowlerads.com/uncategorized/test-post-3/

  50. December 20th, 2008 at 00:28 | #50

    nice plug in

Comment pages
1 2 3
  1. August 4th, 2008 at 00:28 | #1
  2. August 28th, 2008 at 04:20 | #2
  3. September 6th, 2008 at 13:13 | #3
  4. September 7th, 2008 at 07:58 | #4
  5. November 29th, 2008 at 20:05 | #5
  6. January 22nd, 2009 at 05:43 | #6
  7. April 5th, 2009 at 15:42 | #7
  8. May 15th, 2009 at 10:37 | #8
  9. June 10th, 2009 at 22:31 | #9
  10. July 22nd, 2009 at 12:33 | #10
  11. August 10th, 2009 at 15:22 | #11
  12. November 18th, 2009 at 04:34 | #12
  13. March 12th, 2010 at 09:28 | #13