Home > English, WordPress > Introducing the Google AJAX Translation WordPress Plugin

Introducing the Google AJAX Translation WordPress Plugin

March 21st, 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?

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

English, WordPress , , , ,

  1. March 21st, 2008 at 22:42 | #1

    Welcome!

  2. March 21st, 2008 at 22:43 | #2

    Please click the links below to try it. Enjoy!

  3. March 22nd, 2008 at 06:26 | #3

    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 ;]

  4. March 22nd, 2008 at 08:21 | #4

    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!

  5. March 24th, 2008 at 20:13 | #5

    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!

  6. Phoenix
    March 24th, 2008 at 22:27 | #6

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

  7. March 24th, 2008 at 22:35 | #7

    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.

  8. Saen
    March 26th, 2008 at 04:55 | #8

    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?

  9. March 26th, 2008 at 11:26 | #9

    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.

  10. March 28th, 2008 at 15:42 | #10

    Its Fun, Entertain For Visitor To Leave Comment :D

  11. rama
    March 29th, 2008 at 06:47 | #11

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

  12. March 29th, 2008 at 16:50 | #12

    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.

  13. rama
    March 30th, 2008 at 00:49 | #13

    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!

  14. March 30th, 2008 at 12:36 | #14

    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.

  15. March 30th, 2008 at 13:44 | #15

    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.

  16. March 30th, 2008 at 13:52 | #16

    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.

  17. May 16th, 2008 at 08:48 | #17

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

  18. June 16th, 2008 at 07:42 | #18

    Nice job!

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

  19. June 16th, 2008 at 09:17 | #19

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

  20. July 9th, 2008 at 14:11 | #20

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

  21. July 23rd, 2008 at 23:54 | #21

    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.

  22. July 24th, 2008 at 00:39 | #22

    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.

  23. July 24th, 2008 at 00:48 | #23

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

  24. July 24th, 2008 at 00:51 | #24

    You are more than welcome!

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

  25. July 24th, 2008 at 02:29 | #25

    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

  26. July 24th, 2008 at 09:31 | #26

    ops.. yes I reactivated it. Still not working

  27. July 24th, 2008 at 09:38 | #27

    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.

  28. July 24th, 2008 at 10:09 | #28

    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.

  29. July 24th, 2008 at 10:17 | #29

    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.

  30. July 24th, 2008 at 10:26 | #30

    yeah.. it works finally!

    Many thanks, great plugin

    cheers, Alex

  31. July 24th, 2008 at 10:35 | #31

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

  32. August 4th, 2008 at 00:26 | #32

    Thanks Michael Klein for implementation of flag links!

    Say Hello to Google AJAX Translation V0.2.0!

  33. August 16th, 2008 at 12:43 | #33

    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

  34. August 24th, 2008 at 03:45 | #34

    Great i love this

  35. sam
    September 6th, 2008 at 04:02 | #35

    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!

  36. October 28th, 2008 at 18:30 | #36

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

  37. October 28th, 2008 at 19:45 | #37

    when i setup new theme the code is unvaliable…

  38. October 28th, 2008 at 19:50 | #38

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

  39. October 28th, 2008 at 22:19 | #39

    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

  40. January 5th, 2009 at 01:12 | #40

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

  41. Daniel
    February 24th, 2009 at 13:28 | #41

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

  42. March 30th, 2009 at 19:02 | #42

    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?

  43. April 19th, 2009 at 18:23 | #43

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

  44. May 29th, 2009 at 03:24 | #44

    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

  45. May 29th, 2009 at 09:53 | #45

    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

  46. June 8th, 2009 at 01:34 | #46

    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/

  47. jonathan
    June 9th, 2009 at 21:15 | #47

    You post is very helpful to me and I

  48. June 24th, 2009 at 00:13 | #48

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

  49. george
    June 26th, 2009 at 04:28 | #49

    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?

  1. March 22nd, 2008 at 01:20 | #1
  2. March 28th, 2008 at 15:17 | #2
  3. April 26th, 2008 at 03:49 | #3
  4. August 4th, 2008 at 00:04 | #4