You can stroke people with words - Scott FitzGerald

Mobilizing English

Subscribe to Mobilizing English: eMailAlertsEmail Alerts newslettersWeekly Newsletters
Get Mobilizing English: homepageHomepage mobileMobile rssRSS facebookFacebook twitterTwitter linkedinLinkedIn

Mobilizing English Authors: Kirsten Lytsen, Kevin Hoffman, Maureen O'Gara, Kulvir Singh Bhogal, Brad Bouldin

Related Topics: Apache Web Server Journal, Mobilizing English

Apache Web Server: Article

Say That Again... (In a Different Language)

An introduction to programmatic interaction with WebSphere Translation server

The phenomenon of globalization has unearthed a major question. With a huge market of non-English speaking customers, how can we facilitate communication to such a large subset of individuals without paying an arm and a leg for translation? In this article, we'll introduce you to IBM WebSphere Translation Server (WTS) for Multiplatforms v5.0. As you will see, WTS can address the translation needs for an enterprise organization. This product can deliver content to end users in their native languages. The delivery is performed at a fraction of the cost of professional human translation and done on the fly.

We will show you how to install WTS and programmatically interact with it using Java. For our studies, we used the Windows environment. However, WTS is also available for Sun Solaris, AIX, and Linux.

Some Background on WTS
WTS supports bidirectional translation of content for English to/from French, Italian, German, Spanish, Japanese, Chinese (simplified), and Chinese (traditional). For the languages of Korean and Brazilian Portuguese, only unidirectional translation (from English) is supported. WTS is a machine translation (MT) offering. Machine translation refers to the science of automatic translation of human language by computers. WTS consists of MT engines that translate from one language to another. You can also add to the vocabulary of a domain using the User Dictionary Manager tool and change how words or phrases are translated. The User Dictionary Manager is a client-side Java application that allows you to add to the core lexicons of WTS. For example, this extensibility feature might be used to add slang, industry-specific terms, jargon, or trademarks.

For the translation of Web content, WTS has built-in support for WebSphere ApplicationServer (WAS), IBM HTTP Server, as well as HTTP servers from Netscape and Apache. WTS offers on-the-fly and on-demand translation. On-the-fly translation takes place automatically for the end user of a Web page if the user has set the language preference in the Web browser.

On-demand translation prompts the end user to translate from within a Web page. This translation approach can be implemented on an HTTP server as well as WebSphere Application Server (WAS). In the case of an HTTP server, Web server plug-in modules are used to facilitate translation. On the other hand, WAS uses a translation servlet. A sample servlet is provided with the product, so modifying or integrating with your own Web applications is straightforward. Web server/WAS interaction is beyond the scope of this article. However, the Information Center provides a good breakdown of how to couple the services of WTS.

Installing WTS
The installation of WTS is pretty straightforward. When you get to the screen that asks you to select the products you would like to install, choose the options for Gateway and InfoCenter. Also, pick the languages for which you want to have support. For our demonstration purposes, we checked the Spanish option (see Figure 1).

In the connection settings page, enter the hostname or IP address of the machine running WTS.

In the screen asking for the type of trace messages you would like to be displayed, this depends on what messages you want showing up in your trace files. We chose "Add Warning Messages", which will also display Error and Logging messages.

When asked to provide the path to your default configuration file, enter the correct value corresponding to your setup.

Clients accessing via Java require Java 1.3 to interact and operate with WTS's components.

Verifying Installation of WTS
To start the WTS Gateway, simply launch the application from the Start menu and click the start icon. After doing so, you should see an initialization screen (see Figure 2).

You can edit the properties of the translation server using the Properties panel (see Figure 3).

By default, WTS listens on port 1099. WTS can also be started directly from the command line (either utilizing a GUI or not):

  1. Create the server with the WTS GUI: java -classpath wts.jar -ss1M start
  2. Create the server with no GUI: java -classpath wts.jar -ss1M
For the server with no GUI, the startup properties for the translation server are obtained from the file (located in the C:\Program Files\IBMWTS directory under default installation).

Programmatic Interaction with WTS
WTS has exposed APIs in both the Java and C programming languages. We will focus our study on the Java API. WTS is implemented in Java and requires a JVM for its habitation. Interaction using C is facilitated by linking with the supplied WTS library and header file. To start programming a Java client application, you need to have the wts.jar file in your classpath. By default, this file is installed in the C:\Program Files\IBMWTS directory. As shown in Figure 4, clients interact with WTS through the RMI protocol.

The client is provided with a Java API that abstracts the user from the intricacies of the underlying complexity of interaction with WTS.

The code in Listing 1 shows a simple program that takes a string as a program argument. As you can see, the code is rather straightforward (see Listing 1).

To use the program, you need to provide the string to be translated as a command line argument. We used the string "My cat likes milk." Make sure your string is enclosed in double quotes (see Figure 5).

In the code, we use the GetService method (providing arguments stating our WTS hostname and our translation method [Spanish to English, signified by enes - refer to the Information Center for a complete list of language abbreviations]). From the resulting LTinterface object, we can call the jltTranslate method, providing our string to be translated as one of our arguments. The result of this method call is our translated string (see Figure 6).

If you are curious, go ahead and provide the result you got, "A mi gato le gusta la leche," as an argument to the program. Also change the TRANSLATION_METHOD variable to a value of "esen", stating that you want to translate from Spanish to English. The result? You should see a translation that reads "My cat likes the milk." If you recall, our original string was "My cat likes milk." Not bad at all!

There are other utility methods provided by the Java APIs that you may find helpful. For example, you can use the jltFile() method to convert a text file in one language, and output the resulting translation to a new file:

service.jltFile(handle, "c:\\in.txt", "c:\\out.txt");

The jltFile method can also convert HTML files, intelligently skipping HTML tags:

service.jltFile(handle, "c:\\in.html", "c:\\out.html");

This provides a convenient way to translate multiple files into many other languages. Using this capability, you could convert a set of marketing reports, help documentation, or a set of Web pages or text files to nine other languages quickly and easily.

Guidelines for Writing Content
WTS does its best work when writers of the source material follow some basic guidelines. First, writers should be notified that their text will be translated into a different language, so it is best to pick words and phrases just as if they were speaking to someone who is not fluent in their native language. Using shorter sentences and generally avoiding idioms and slang expressions will make translation easier (whether translation is performed by machines or by humans). It's important for Web designers to remember that .gif files that contain words cannot be translated by a machine, so it's best to avoid placing text inside graphic files for buttons or icons. If writers keep these rules in mind as they write content, your translation results will improve. For a more extensive list of guidelines, see the document "WTS - Guidelines for Writing Content that Will Be Machine-Translated" mentioned in the Resources section.

WTS offers a set of flexible APIs and features that give developers the freedom to leverage the product in many useful ways. Translation can be used for static content and dynamic Web content, and can even be integrated into real-time chat applications such as Lotus Instant Messaging. IBM's WebSphere Portal product includes built-in support for WTS, and there is no programming necessary to enable the translation of individual portlets, or if you prefer, the entire portal page. Using the techniques presented in this article, you can write your own programs that take advantage of WTS's powerful features. Depending on your translation needs, the cost savings can add up quickly. Whereas human translation typically costs between $0.15 and $0.45 per word, depending on the languages and type of document, WTS deployed in your organization can cost as little as fractions of a penny per word. Other advantages of machine translation are that translation services are always available and can translate up to 500 words per second (a typical human translator may top out at 2,500 words per day). Many organizations decide to reduce costs by using a combination approach, first translating by machine, followed by proofreading by human translators.

The global Internet allows e-business to reach the corners of the earth. The problem is, not every corner of the earth understands English. Not catering to such a large clientele is the equivalent of shutting the doors for your own e-business. In this article, we showcased WebSphere Translation Server and showed you how the product can be easily installed and configured to provide translation services programmatically. The offerings of WTS are quite extensive. You can learn more about the offerings by viewing the product Information Center. The Information Center is also found in the InfoCenter directory of the product's first installation CD. For IBM customers who have WebSphere Portal Server Enable or Extend, they should be aware that WTS comes bundled with the product.


  • IBM WebSphere Translation Server Product Page:
  • WebSphere Translation Server InfoCenter v2.0 (G210-1527-00):
  • User Dictionary Manager v2.0 InfoCenter:
  • WebSphere Translation Server Support Site:
  • WTS - Guidelines for Writing Content that Will Be Machine-Translated:
  • Globalizing Your e-business
  • More Stories By Kulvir Singh Bhogal

    Kulvir Singh Bhogal works as an IBM Software Services for WebSphere consultant, devising and implementing WebSphere-centric solutions at customer sites across the nation. He has over fifty patents pending in a myriad of technology areas. He can be reached at [email protected]

    More Stories By Brad Bouldin

    Brad Bouldin works as an IBM Portal specialist assisting customers with planning, architecting, and implementing e-business solutions.

    Comments (0)

    Share your thoughts on this story.

    Add your comment
    You must be signed in to add a comment. Sign-in | Register

    In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.