Php - the new google translation API

Posted on 2011-10-09
Last Modified: 2012-05-12
Hi E's, recently google changes the translation API, now we have to pay to have access to that API. The payment not was the problem, I think is $20 to 1 million characters. My problem is the new version of the API is very poor in php examples.
I have now the key that google gives me, but I don't know what is the code for substitute the example in snippet code:
   $gt = new Gtranslate;
    echo "Translating [Hello World] from English to German =>".$gt->english_to_german("hello world")."";
 } catch (GTranslateException $ge) {
    echo $ge->getMessage();

Open in new window

Maybe any expert have the same problem of me, and can help me.

I need a simple example for substitute the old code, can you help?

The best regards, JC
Question by:Pedro Chagas
    LVL 11

    Accepted Solution

    Hi I think this is what you are looking for:

    Best Regards
    LVL 3

    Author Comment

    by:Pedro Chagas
    Hi @f_o_o_k_y, I thing that was a good example, I will test later in my home (I'm on my mobile phone).

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    This is a general how to create your own custom plugin system for your PHP application that you designed (or wish to extend a third party program to have plugin functionality that doesn't have it yet).  This is not how to make plugins for existing s…
    Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit ( and similar technologies have enjoyed wide adoption, making it possib…
    The viewer will learn how to dynamically set the form action using jQuery.
    This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

    794 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now