1. Globalize Your Web Presence: Selecting Additional Languages for Your Site
  2. Translate Web Sites Automatically Using Site Translator

Get the inside track on all the hot news regarding DeskShare products, new releases, special promotions and discounts.

Subscribe to our DeskShare News.

Site Translator 4.17

Translate Web Sites Automatically Using Site Translator

The world keeps getting smaller.  With the global economy, it is vital that your web pages are available in multiple languages.  With Site Translator, you can automatically translate your entire website in a few minutes.

Automatic translation relies on Site Translator's command-line interface.  By including Site Translator commands in a batch file (a simple script for Windows); you can schedule translations using the Windows Scheduled Tasks system.

The command-line interface for Site Translator is very simple.  To be translated, the files must be on a local drive.  You can use Auto FTP Manager to automatically download all the files from a website to your computer, on a schedule by following the directions in the article, "Schedule and Automate FTP File Transfer Tasks".

For example, I'll demonstrate the procedure to create a batch file for the following website "Cooking With Peppers" (not associated with any real pepper farmers):

Site Translator - English Language Web Page

This site has only three pages: the home page, a page for farmers, and a page for consumers.  We'll create a batch file to convert all the three pages to Spanish.

A simple batch file is just a list of commands.  The command to translate a file to a new language is:

"Site Translator.exe" "C:\Peppersite" -from english -to spanish -out "c:\Peppersite-Spanish" –subdir

I'll explain each element of that command.  The quotation marks are needed because the name has blank spaces in it.  Next is the folder that contains the untranslated web pages.  "-from english -to spanish" means that the original language is English, and the pages should be translated into Spanish.  "-out C:\Peppersite-Spanish" instructs the program to translate into Spanish.  "-subdir" is to translate the files in the given folder, along with the contents of any subfolders.

To create a batch file, I'll use the Windows Notepad from the Accessories group of the Start Menu Programs listing.  I'll also add lines to translate the web site into French and German, and save the file as Peppertrans.bat.  I created a special directory for batch files, C:\Batch, to store the files if I need to find it later.

The batch file will look something like this:

"Site Translator.exe" "C:\Peppersite" -from english -to spanish -out "c:\Peppersite-Spanish" –subdir
"Site Translator.exe" "C:\Peppersite" -from english -to french -out "c:\Peppersite-french" –subdir
"Site Translator.exe" "C:\Peppersite" -from english -to german -out "c:\Peppersite-german" –subdir

To test the batch file, just open the Start menu, choose Run.  In the Run window type CMD then press Enter.  At the command prompt, type the name (and path) of the batch file and press Enter, for instance C:\batch\Peppertrans.bat.  The translated files are now stored in the proper folders.

Here's the translated page in Spanish:

Site Translator - Translated Spanish Language Web Page

The next step is to translate the page automatically, once a week.  That's very simple.  First, start the Scheduled Tasks application: click Start >> All Programs >> Accessories >> System Tools.  Click File, New, and Scheduled Task.  I'll name mine "Translate Pepper Site".  Then, right-click on the task in the list and click Properties.  Use the Browse button to select the batch file you created, then switch to the Schedule tab and choose how often and when to run your Scheduled Task.

Certain features of Site Translator can only be used from the graphical interface.  You will probably want to configure the translation memory, which allows you to customize the way certain words and phrases are translated.  You can use this feature to be sure that industry-specific phrases and words are translated correctly.

By using the command-line features of Site Translator, you can create scripts and scheduled tasks that save your time and effort, and even regularly translates entire web sites automatically. 

Copyright © DeskShare Incorporated.  All rights reserved.