Improved version of translate.js to translate.php