Introducing the Google AJAX Translation WordPress Plugin

Mar 21 2008

UPDATE:

Please see this page for the new version: Google AJAX Translation 0.2.0

Google just released a new API yesterday: Google AJAX Language API.

AJAX Language API is built on top of Google Translate, it current supports 13 languages and 29 translation pairs. It is new but it is already very powerful. If you want to know more about how to use it on your website, please see Google AJAX Language API Document for more details.

We in Savvica want to use this cool technology in our awesome website: LearnHub.com. In the middle of doing this today, I was thinking about to enable this feature on my blog too. :)

So, here we go, the Google AJAX Translation WordPress Plugin is arrived.

Please download from here:

http://wordpress.org/extend/plugins/google-ajax-translation/

Installation is very simple:

  1. Download the plugin archive and expand it
  2. Put the ‘ajaxtranslate.php’ file into your wp-content/plugins/ directory, or put the ‘ajaxtranslation’ folder into your wp-content/plugins/ directory.
  3. Go to the Plugins page in your WordPress Administration area and click ‘Activate’ for Google AJAX Translation.
  4. Have fun with your blog readers.
  5. Please see my blog as an example

Couple things still need to know:

  • Google Ajax Translate only allow 500 characters right now (March 2008)
  • So this plugin only supports translating the first 500 characters of your blog comments
  • In the current version(0.1), I only enable comment translation by default. There are two reasons for this:
    • Most of your posts are more than 500 characters, but most of your blog comments aren’t
    • Google will translate characters inside of html tags, which will mess your blog for sure
  • If you still want to use it with your post too, please comment out line 79 in ajatranslation.php
  • This is just an initial release, lots of feature will be added in. Please stay tuned.

If you want to do some changes and glad to share with all of us, please feel free to comment here or send me email @ libin.pan at gmail dot com.

I hope you will like it.

Want to know more?

59 responses so far

  1. Welcome!

  2. Please click the links below to try it. Enjoy!

  3. [...] Introducing the Google AJAX Translation WordPress Plugin | Libin Pan Google AJAX Translation plugin enables Google AJAX Language API on your blog, so your blog readers can easily translate your blog comments into other languages. It provides a quick, simple and light way to add internationalization feature onto your blog. (tags: Google AJAX Language wordpress translate translation) [...]

  4. Awesome of you to get this out so quickly! I will be working on a Drupal module soon. I posted about the first few hours I spent messing around with the API, and like you I made my comments translatable ;]

  5. Thanks, Dave!

    I just take a look on your blog. Your implementation looks great!

    I really like your idea about Facebook and twitter. 500 characters limit sound perfect for these shout wall posts or status.

    I was thinking use uOGT in another day, but found my website will be soon rejected by Google Translate Service. This AJAX one really helps!

  6. Request for adding into WordPress Plugins List has been approved today. So please download from
    http://wordpress.org/extend/plugins/google-ajax-translation/

    And all the new changes will go there too.

    Thx!

  7. 插件不错,但是想要全文翻译的话应该如何设置呢?

  8. Thanks Phoenix!

    To enable fulltext translation, mine may not be a perfect solution at this moment. As Google limits 500 characters for every request.

    But you still can give a try:
    Uncomment line 79 in ajaxtranslation.php

    If you want to have a more professional one, please give a try on:
    http://wordpress.org/extend/plugins/global-translator/#post-2877

    This is the best one I’ve found so far. But too bad it is not free.

  9. This is a great idea!

    However, the first paragraph of my comments are being bolded since I activated this plug-in. Has this happened to anyone else?

  10. Thanks Sean!

    The problem has been fixed. Please download from wordpress for the new version and overwrite your exist one.

    Please feel free to let me know if it works for you.

  11. [...] google-ajax-translation-wordpress-plugin [...]

  12. Its Fun, Entertain For Visitor To Leave Comment :D

  13. is this only for WordPress? i need to find language translation API , but it not online, it should work on my localhost!

  14. Yeah, the plugin is only for WordPress. But the AjAX Language API is not.

    I am not really sure about how you want to make it wok on localhost.

    The AJAX Language API is a AJAX wrapper for Google Translate Services. If you want to use it, you need the access to the Google servers, which means you need to be online.

    As long as you have internet access, it doesn’t matter you call it from your hosted server or your local machine. It should work.

  15. actually i wnt to develop a chat program, which run only in internal network(most probably no internet facility available), so i need to store tht translation api in my local server!, is there any way to do this?

    thanks for u reply!

  16. Thanks Libin, it works great. I am translating my posts too, but problem is that my post images do not display when after user clicks alternate language. Any ideas? Please see http://dave.jp.

  17. Hi Rama,

    Your idea sounds very interesting! Put internationalization into chatting is absolutely a great feature. But I am afraid that you may need a translate services inside your internal network if you want to make it work without internet access.

    Some professional translation companies have this kind of software. But I believe the price will be way more higher than what we expect.

  18. Hi David,

    Your blog looks very beautiful!

    Let me tell you what plugin does for translation. When the user click “View Post/Comment in ??? Language”, plugin will get the innerHTML of the current post/comment, then filter out all the html tags, such as
    < p >, < a href=..>,
    then send the pure text to google and wait for the translated result.

    The reason for filtering html tags out is: if you send them within your text, google will translate the words inside of tags and return it back. Which will mess up the whole page.

    I am trying to find a better solution for this, but no lucky yet.

  19. [...] into other languages.The Google AJAX Translation WordPress Plugin provides a quick, simple and lhttp://blog.libinpan.com/2008/03/21/introducing-the-google-ajax-translation-wordpress-plugin/CodeToad – Javascript – Enable and Disable form elements.Apr 8, 2008 … javascript – enable and [...]

  20. Google now added more languages to their API.
    The problem is that it’s too many.
    is there any way for the language select to be in a dropdown menu (some thing like the google translate mypage tool
    P.s
    Great plug in I love it!!!

  21. Nice job!

    But how can I remove some of the languages which I don’t want to be translated?

  22. Thanks Clementtang!

    I am working on the next version now, which will have the options for choosing languages, but for now, you could just edit wp-content/plugins/ajaxtranslation/ajaxtranslation.php.

    From line 46 to 58, remove anyone you don’t want and it should work.

    Let me know if you have problem. :)

  23. WOW thanks… I was looking for this plugin… and now will wait for a new one..

  24. Hi Libin, thx for ur work^^
    I’d like to ask if this plugin supports Linux/Mac OS, it is not working on my iMac(Leopard + Safari + Firefox), thx.

  25. Thanks so much, loewez!

    The problem is in the theme what I am using now. It was missing one line which is very important:
    < ?php wp_footer(); ?>

    I’ve added it back. So the translation plugin should be working again.

  26. Yeah it works now, thank u for ur speedy reply^^

  27. You are more than welcome!

    You may notice this already, the translation plugin does work on Admin/Comments list too. :)

  28. Hello Libin,

    unfortunately it does not work on my blog! No idea why..

    have a look here
    http://www.tecnopolis.eu/blog/2008/05/alla-ricerca-del-gadget-che-c%c2%b4e-nokia-n95/#comment-31

    I am running WP 2.5 + several plugins (among them Get Recent Comments).

    Thank you in advance for any help!

    cheers, Alex

  29. ops.. yes I reactivated it. Still not working

  30. Looks like it is the same problem as I had. 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.

  31. HI Libin,

    I tried your tip, yes it hadn’t the wp_footer linecode. Put it, but still nothing.

    My theme is a modified Effercio Blue theme
    http://cdharrison.com/2007/09/01/effercio-blue/

    I can provide you any file by email.

    thanks, A.

  32. OK. It’s my fault. :)
    Please remove the space between < and ?.
    The line of code is:
    < ?php wp_footer(); ?>

    The space here was added by wp, so it could be displayed.
    Please give it a try again.

  33. yeah.. it works finally!

    Many thanks, great plugin

    cheers, Alex

  34. You are more than welcome! Glad to hear this thing is useful. :)

  35. [...] 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. [...]

  36. Thanks Michael Klein for implementation of flag links!

    Say Hello to Google AJAX Translation V0.2.0!

  37. Hi there! I always love to google for WordPress Plugins as I always find nice site like yours. Everyday there are new plugins and themes for wordpress and so you can pimp up your installation from time to time. :-) Btw: Your article cing the Google AJAX Translation WordPress Plugin | Libin Pan was the best I found today! Regards! Jens

  38. Great i love this

  39. sorry if i double posted, but i was wondering if there is a way to use this for Posts and Comments, but not for Pages.
    thanks!

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

  41. when i setup new theme the code is unvaliable…

  42. Please visit my site:www.vietproblog.com and tell me about it’s error.Thanks u very much

  43. Thanks for the awesome plugin.

    I tested the plugin on my site. My site used FeedWordpress plugin to collects feeds from other sites.

    There is problem is that Google AJAX Translation WordPress plugin doesn’t display any flags in the rss posts, but in manual posts the plugin worked fine.

    Is there any fix soon?

    Thanks for kind support

  44. Which one is better ? this one or the n2h one ?

  45. you can change in php file if you want more than 500 characters… Why only 500???????????

  46. Ando perdido la pagina no traduce todo el articulo? la pagina en la que instale ese plug in solo me traduce una parte alguien sabe porque?

  47. Очень полезно

  48. Hi and thanks for a good plugin!
    I want to know how i call the translate function manually. IE so I can place the “translate” link where I want and not automatically and the end of each post.

    Cheers

  49. Hi and thanks for making this awesome plugin!! totally awesome ;-)

    However the plugin only translates our pages and not posts. The translate button it present on both, the drop down appears on both etc but when you select a language (in a post) nothing happens. any ideas?

    we’re a music charity based in London, UK with a global following so this plugin is unbelievable for us. Thank you sooo much x

  50. Hi Emil and Steve,
    I may be able to help you with your questions but it’s easier if you start a thread on the WordPress forums.
    http://wordpress.org/extend/plugins/google-ajax-translation/

  51. You post is very helpful to me and I

  52. Hey, the translator rise average time my visitors, very useful. Thanks,.

  53. It’s a great tool but I have this problem: it translates comments but it can’t translate posts. Testing with WP 2.8 both latest IE and Firefox. Any idea please?

  54. Although post is nice but I am not agree with all the points. Any way best as compare to others…

  55. Intriguing. Have been trying to learn a new language for a while so this is extremely relevant! Thanks.

  56. can i translate to malayalam?

  57. THX that’s a great awnsre!

  58. Why i can’t install OnTranslator on my macbook? Can’t understand what the problem. Does anyone uses that translator?

  59. cool information Thank you very much!

Leave a Reply