PATH://adammoro.net/blog/Web Development/

G-Translate Coming Soon

When I noticed there aren’t many options for translating the text on your (non-CMS) website in a way that gives you ALL the credit, I decided I’d give it a shot by writing my first real PHP script. Here’s how I did it…

First stop was Google Translate to find out how many different languages I had available to use with the script. Next stop was FamFamFam to get those pretty little flag icons. And finally, the editor. Using the almighty libcurl and PCRE libraries, I wrote a very basic script that grabs the translated text from Google and places it right back on your page (and without anything from Google but the text!). Now that I had a working, but clearly immature, script I wanted to make sure I didn’t do anything right from the start that would put its users at risk. Being a member of Quadszilla’s forum clearly has its benefits but there’s one benefit I would say justifies the $100/mo bill alone. An example of this would be what happened the other day when I PM’d RSnake from Ha.ckers.org (yep, he’s one of the moderators :)) and asked him what it would cost for him to look at the script from an XSS standpoint. Next thing I knew, I had a hardened script (and the confidence of knowing the guy who wrote the book on XSS said he “didn’t find a single hole.”) Once the script is complete (well, ready to release), the next stop will certainly be SecTheory - Internet Security to get a quote. Thanks again, RSnake!

Rewriting the URLs proved to be too difficult for my futile Apache modrewrite skills so next stop was oDesk. Let me just say, I don’t think I could have ever lucked out as much as I did with the developer I hired. His name is Vadim Zanfirov and he..is..the..MAN! If you’ve never outsourced your development and are wondering if it really can be as good as some people say, I can’t give you a better recommendation than to contact Vadim. You can hire him through his oDesk page and he’ll get back to you very shortly afterwards. Then he’ll get on Instant Messenger with you and work on the job while answering your questions (I’m probably a developer’s nightmare with all the questions I ask). I’m sure by now you can tell how impressed I was with Vadim (this is the least I could do for someone who continued to work on the script to change something I failed to mention in the job description and do so AFTER I had already closed the assignment and paid the bill) so I’ll stop now but seriously, check him out if you’re in need of a great (and affordable) PHP developer. He has many other skills as well including: MYSQL, HTML, JavaScript, AJAX, Smarty, Joomla, and yes, he can even be your Drupal developer.

So now I have a working version of the script that’s both search friendly (oh yeah, did I mention the generated pages are also valid XHTML 1.0 Transitional?) and safe from XSS attacks. The cost for me to do all of this? $59.24 (notice the price? $59.24-$11.11 = a $48.13 tip).

Well, I’m off to work on this thing some more and hopefully get it out next month sometime. If anyone’s interested in beta testing (that means you get a free copy of the script to use on your website…I’ll help you install it if you need me to), drop a comment here or shoot me a tweet/im/email/whatever.

Leave a Comment