ADOBE SYSTEMS INCORPORATED

Copyright 2001-2002 Adobe Systems Incorporated
All Rights Reserved

NOTICE: Adobe permits you to use, modify, and distribute this file in accordance with the terms of the Adobe license agreement accompanying it. If you have received this file from a source other than Adobe, then your use, modification, or distribution of it requires the prior written permission of Adobe.


Extension Name: Translate Time

Folder name: Translate Time


Description:

This sample demonstrates how to use the JSXTranslator object and how to implement a markup translator. See the documentation for more information on JSXTranslator. A markup translator is called before the GoLive parser parses the file. The translator is able to modify the document markup before it is sent to the parser.

This sample translates a tag called <time>. The translator is activated on file extensions htm and html. These are specified in the <jsxtranslator> tag (see below).

The time tag is replaced by the current time. See the translate() function in the <script> tag (see below).

According to the implementation, the <time> tag is defined as follows:

<!ELEMENT time - o EMPTY>
<!ATTLIST time
format CDATA #IMPLIED >

The translator translates the contents of the format attribute as follows:

%H: hours

%M: minutes

%S: seconds


How to use

  1. Create a new document.
  2. From the Translator Tags Objects Palette, drag the <time> tag object onto the page. Notice that the current time is displayed on the <time> tag.
  3. Highlight the <time> tag. The Inspector shows the current setting for the format attribute (%H:%M:%S).
  4. In the Inspector, change the format attribute (%H hours, %M minutes, %S seconds). See the changes reflected in the document view.
  5. In source view, you can see the <time> tag.
  6. In Split View (select "Toggle Split View" at the bottom of the Layout window), you can see the <agl:translated> tag contents that this extension updates. <agl:translated> is the translation of the <time> tag.
  7. Save the document, and view the document in a text editor. See the <time> tags.
  8. Open the document in GoLive. The <time> tags are translated, and display the current time.

Removing the blue color

If you would not like the time objects to be displayed in blue, create an attribute called "blend" set to "no" on to the jsxtranslator object below.


Editing this sample

It is necessary to turn off this extension before editing this file. If the extension is not turned off, <time> tags that occur in this document will be translated to <agl:translated> tags.


Module Definition:

Scripts:


User Interface Tags:

Image Define images here. These are referenced by the picture attribute of the jsxpaletteentry and jsxpalettegroup tags.

The little icon displayed in the Objects palette tab:

The icon to be displayed in the Objects palette:

Translator Define a translator that imitates server side replacements.

Inspectors Define Inspectors for custom tags

Palette Group Define a new tab for the Object Palette, or add to an existing tab.

JSXLocale Specify localized versions of strings used in menu items, dialogs, alerts, etc.

US DE
time Inspector time Inspektor
Time Format Change Zeit Format Änderung