News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

SitePoint PHP Blog:
Using Google Translate API with PHP
October 31, 2013 @ 13:14:11

On the SitePoint PHP blog Jacek Barecki has a new tutorial showing you how to use the Google Translate API to handle the translation of dynamic input that may have come from other sources (including users).

If your site serves visitors from different countries, you may already have translated all its static content into several languages. But what to do with the content posted daily by the users in comments, opinions and ratings? As this may be as valuable a part of your site as the static content, you should think of finding a way to translate it into other languages. One service that can help is, of course, Google Translate.

He walks you through the process of setting up a Google API account (with screenshots) and how to turn on the Translate API specifically. The Translate API is not a free service, unfortunately, so you'll need to set up some billing information to use it. He then points you to where you can find your API key and shows a sample API call to get the currently supported languages. With that working, he shows you how to make an actual translation call, passing in the text and desired language on the URL and sending it to the API via curl. He also talks some about handling errors based on HTTP response code and the message returned.

0 comments voice your opinion now!
google translate api tutorial curl

Link: http://www.sitepoint.com/using-google-translate-api-php/

blog comments powered by Disqus

Similar Posts

GoodPHPTutorials.com: SQL Injections in PHP with MySQL

Fabien Potencier's Blog: Create your own framework... on top of the Symfony2 Components (part 7)

WebReference.com: XML and PHP Simplified - Formatting XML Documents

CloudSpring.com: Using the Rackspace PHP SDK

Master Zend Framework: Easy Cache Configuration With StorageCacheAbstractServiceFactory


Community Events





Don't see your event here?
Let us know!


introduction symfony voicesoftheelephpant community release framework api podcast list bugfix deployment package library opinion laravel series language tips install interview

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework