I came across this page which explains how to use the Google API to translate your page. The issue here is that the Javascript explained is all inline.