This project is based on the the following translation plugin:
[url removed, login to view]
Your task will be:
- Download the plugin and take a look at the code
- make changes in the code as described below
- remove all the code that is not necessary for this task
I want to use this translation plugin together with another plugin.
In that plugin's code, I want to have a call to a function like this:
$content = 'the posts content in string form...';
$newcontent = global_translation($content,$sourcelanguage,$destinationlanguage);
Your task is to provide the "global_translation" function by making changes to the Global Translator plugin.
The code you write should try the four translation services that are used in the original plugin. First use a random engine, then choose another service if the translation failed for some reason, etc. If all translation engines are unavailable, I want to have a simple output stating that the translation failed.
The random user agent strings of the plugin should be used.
To fully understand this project, it's best to take a quick look at the plugin's source code.
Leave a comment in the message board if you have questions.
Important: I cannot use fopen on my hosting service (dreamhost). You will need to use curl instead.
I was told that the functions fgets(), fputs(),fsockopen() and feof() will work. So you don't have to change them in the plugin.