Adding the Google Translate Widget to OSCommerce

When we first installed OS Commerce for our ReloadingInternational site we tried installing and enabling several languages. Since the site is targeted at “international” customers, we thought this would be great.

The problem with that is, any custom pages have to be translated and maintenance got to be a nightmare any time a page changed. It finally got to the point we had to disable any languages other than English.

I had discovered a jquery plugin that we could use to translate specific parts of pages (or entire pages) using Google’s translation service. I just never quite got around to it.

A couple of days ago with the announcement of the Google Translation widget, Google solved the problem for me. It took all of 10 minutes and the site is now available in 39 languages. Here’s how.

Because OS Commerce includes several languages, it also includes a language selection box. The code for this box is located in catalog/includes/boxes/languages.php. All I did was replace the box contents with the Google widget code. Here is what my finished include file looks like: languages.php

We have had cases where English speaking customers have helped their non English speaking friends place orders so this should be a nice enhancement to the site.

Comments are closed.