Preparing a Website for Dynamic Translation

Designating Target Objects

LanguageCache is not a Dynamic Translation Engine. Our methodology, however, is designed for sites which are using "client side" translation scripts. Basically, this means we are focused on systems where the user downloads the website in the original language, and then the translation commands are sent from the user's web browser.

As it would be bandwidth-intensive to send the entire page, the most efficent method is to restrict translations requests to specified portions of the page. HTML standards make this quite simple, as one of the standard attributes of an html element is "LANG". We can simply assume, that any HTML tag with the LANG defined contains test that should be translated.

An simple example would be the paragraph element:<P>. To make this compliant, you would simply change it to: <P lang=en>.

The scripts LanguageCache uses to manage the translations simply cycles through the elements in your HTML page. Any text found within a set of language defined tags such as this: <P lang=en>HERE IS SOME TEXT</P> would be recognized as English text, a request to languageCache would be made to see if a translator has typed in a custom replacement. If there was custom content cached at LanguageCache, it would replace the english contents.

If there was nothing in the LanguageCache database, the program simply moves on to the next element. As the program moves through the page, it resets all of the LANG attributes to the newly selected language.

The exact same way the script cycled through all the elements looking for that LANG marker for LanguageCache, the script for dynamic translation seeks out those elements who still have a LANG attribute which hasn't been changed. While LanguageCache provides scripts that request translations from Google, any dynamic translation system can offer the same process.

The primary thing you must know is that any HTML element you choose can be included in LanguageCache.