I need some help in implementing Google's API Ajax/JS translation code on a PHP website in order to translate text on the fly.
I will be passing variables to the Google JS code from a database. The Google JS will then translate this and throw it back out as a php variable.
1. For example, I have a php variable called $page_name
2. Lets assume $page_name = "Hello"
3. Google translates $page_name into french and outputs "Bonjour"
4. The php variable $page_name then equals "Bonjour"
The language code (ie 'fr') will also be sent as a php variable called $site_language
I only need one example of the code which I can replicate for the other 10 or so variables
The PHP variables will include HTML as they have been written to the database through a CMS WYSIWYG editor.
I UNDERSTAND THAT THIS MAY BE A DIFFICULT TASK SO IF YOU HAVE AN ALTERNATIVE SOLUTION, PLEASE ADVISE.
Coders 9.5+ or more please
Thanks