NetTalk Central

Author Topic: Translating Web Pages  (Read 12525 times)

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11171
    • View Profile
Translating Web Pages
« on: May 13, 2009, 07:15:51 AM »
This applies to NetTalk version 4.32 and later.

There is a method in the WebHandler class called Translate.
By embedding code in this method you can translate much of the text generated onto your web pages.

There is no translation mechanism built into NetTalk itself, rather it offers the embed point, in the web handler, so you can "plug in" your favorite translation tool.

There is also a property,
self.translateOff
which can be set in the code to "turn off" translations.
Thus if you embed code in the Translate method you should test this property. If it is greater than zero, then bypass your translation code.

Note - do not test this property = 1 as it may contain a value > 1.

You may set the property in your code, if you wish to suppress translations. Set the property by incrementing it, and decrementing it. Using this approach, rather than explicitly setting it to 1, or 0, will allow for nested code to turn translations off.

Cheers
Bruce