Saturday 12 November 2011

How to Use Google Translate for API & PHP

Google’s translation API is a useful tool for developers who wish to provide their users with the ability to translate foreign-language Web content into their native languages. PHP is the primary programming language that is used to interact with the Google Translate API, which can be called to using different parameters and then output results into specified languages and formats.

Difficulty:Moderately Easy1
Determine what kind of translation you’d like to perform using the API. Choose between making a literal language translation, making a transliteration between different written languages, deploying a virtual language keyboard or adding diacritical marks for content in a language such as Arabic. This tutorial will assume that you want to translate language on a Web page into a different language.
2
Open your website’s HTML code in an HTML editor and find the “header” section of the HTML markup.
3
Insert the following lines of PHP code into the header section of the Web page:
4
Save the modified HTML file with the added PHP script and load it into your development environment or onto your production Web server to validate that a language-selection drop-down menu has been added to the top of your Web page.

Find Out More...!

No comments:

Post a Comment