The structure of the array is relatively rigid. The number of array elements is specified when the Array
variable is declared, and a particular text string must correspond to the proper array element. The array
order is as follows:
n translatorClass: The translator??™s unique name used in JavaScript functions. The name has to
begin with a letter and can contain alphanumeric characters as well as hyphens or underscores.
n title: The title listed in the menu and the Translation category. This text string can be no longer
than 40 characters.
n nExtensions: The number of file extensions, such as .cfml, to follow. This declaration tells
Dreamweaver how to read the next portion of the array. If this value is set to 0, all files are acceptable.
n extension: The actual file extension without the leading period.
n nRegExps: The number of regular expressions to be declared. Should this value be equal to 0, the
array is closed.
n RegExps: The regular expression to be searched for by Dreamweaver.
n runDefault: Specifies when the translator executes (always, never, or conditionally).
The number of array elements??”and thus, the detail of the function??”depends entirely on the translator.
Here, for example, is the code for getTranslatorInfo() from Live Picture??™s translator, where a file
must have a particular
tag to be translated:
function getTranslatorInfo(){
returnArray = new Array( 5 );
returnArray[0] = ???FPX???; // translatorClass
returnArray[1] = ???Flashpix Image Translator???; // title
returnArray[2] = ???0???; // number of extensions
returnArray[3] = ???1???; // number of expressions
returnArray[4] = ???
return returnArray;
}
By comparison, the standard SSI translator??™s getTranslatorInfo() function has 10 array elements, and
Webmonkey??™s XSSI has 17.
Pages:
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771