The Translate method provides a very convenient way for you to easily translate the values returned by certain properties into their meaning. This is especially handy if you wish to display a visitor’s browser settings to them for troubleshooting purposes (or for you to record the information to a log for your own troubleshooting).
For example, assume your Plugin_RealPlayer property has a value of 3. What does this value of ’r;3’ indicate? The Translate method would return the string "RealPlayer G2 installed" in this case. Wouldn’t that be more useful to display to your visitor or your tech support team than ’r;3’? That is where the convenience of this function comes into play.
As another example, assume the user’s Plugin_Flash property contained a value of -1 to indicate that Flash detection was not available for that user. Was this because their JavaScript was disabled? Or because they were using a browser that did not support Flash detection? The Translate method would tell you by returning an appropriate string (such as "Not detectable with this browser" or "Not detectable with JavaScript disabled").
Tip: The browserinfo.asp script in your BrowserHawk directory makes extensive use of the Translate method and provides a great example of how to best use it.
Important note: Remember that the Translate method is designed for convenience solely for display to an end user or your own logging. The return values of the Translate method are subject to change in newer versions of BrowserHawk. Therefore you should not use IF THEN logic to compare the results of the Translate method. For example, do NOT do this:
If BhObj.Translate("Plugin_Flash") = "Version 5" then …
instead do this:
If BhObj.Plugin_Flash = 5 then …
Syntax:
bhObject.Translate(keyAsString)
keyAsString - The key to tell the Translate method which information you would like it to translate for you. This must be one of the extended property names, such as "Plugin_Flash", "CookiesEnabled", and "ConnectionSpeed".