Added the translate JS function to the base template for easy reuse.
1. Translate link element is hidden and the spinning wheel is shown.
2. $.post() sends an Ajax POST request to server (no page reload occurs).
3. When server issues a response, that is provided as argument to the done() function, which will be doing the data insertion into the page.
4. In done(), we overwrite the translate link in the DOM with the translated text, hide the spinning wheel and display the translation.
5. Errors, if any, are handled by fail().