Arguments
,
docName
siteRoot
•
The
docName
be translated.
•
The
siteRoot
contains the document to be translated. If the document is outside a site, this string might be
empty.
•
The
docContent
Returns
A string that contains the translated document or an empty string if nothing is translated.
Example
The following instance of the
translateASP()
called ASPTrans:
function liveDataTranslateMarkup(docName, siteRoot, docContent){
var translatedString = "";
if (docContent.length > 0){
translatedString = ASPTrans.translateASP(docName, siteRoot, docContent);
}
return translatedString;
}
Determining what kind of translator to use
All translators must contain the
they must reside in the Configuration/Translators folder. They differ, however, in the kind of code
that they insert into the user's document and in how that code must be inspected, as described in
the following list:
•
To translate small pieces of server markup that determine attribute values or that conditionally
add attributes to a standard HTML tag, write an attribute translator. Standard HTML tags
that contain translated attributes can be inspected with the Property inspectors that are built
into Dreamweaver. It is not necessary to write a custom Property inspector (see
translated attribute to a tag" on page
•
To translate an entire tag (for example, a server-side include) or a block of code (for example,
JavaScript, ColdFusion, PHP, or other scripting), write a block/tag translator. The code that is
generated by a block/tag translator cannot be inspected with the Property inspectors that are
built into Dreamweaver. You must write a custom Property inspector for the translated content
if you want users to be able to change the properties of the original code (see
translated tags or blocks of code" on page
,
docContent
argument is a string that contains the file:// URL for the document to
argument is a string that contains the file:// URL for the root of the site that
argument is a string that contains the contents of the document.
liveDataTranslateMarkup()
, which is contained in a DLL (Windows) or a code library (Macintosh)
getTranslatorInfo()
and
translateMarkup()
340).
345).
Determining what kind of translator to use
function calls the C function
functions, and
"Adding a
"Locking
339
Need help?
Do you have a question about the DREAMWEAVER MX 2004-EXTENDING DREAMWEAVER and is the answer not in the manual?
Questions and answers