Previous Topic: Translation ScriptsNext Topic: Test a Translation Script


Add a Translation Script

Important: When creating a translation script, never use the Tools object in the global scope. Use it only in the Script procedure and function.

To add a translation script:

  1. In the Translation Scripts page, click Add New. The Translation Script Details page is displayed.
  2. In the General tab:
    1. In Name, type the name of the translation script.
    2. In Description, type a description of the translation script.
    3. In Status, select Disabled to define the translation script without running it or Enabled to enable the script to run.
    4. In Time zone, select the internal time zone for the script. All dates in the script use the same time zone and date format according to the defined time zone. This field is a mandatory.
    5. Select Run every to schedule the interval for the translation script to run.
    6. In Next run time, enter the initial start time of the translation script. This option is enabled if Run every is selected.
    7. In Run Script after, select the script that is run before this task.

    Note: Use Run Script after only when there are two scripts that are run simultaneously.

  3. In the Translation tab:
    1. Select Run on new entries if the translation script is run on new entries only.
    2. Select Run only on pending entries if the translation script is run on pending entries only.
    3. Select Run on all Tables if the translation script is run on all translation tables, even those that are created in the future. (For best performance, this option is not recommended.)
    4. In Used translation tables, select the translation tables that are relevant to the translation script from the Available Translation Tables list and move them to the Include list.

    Note: For optimal performance, a Translation Table is assigned to only one Translation Script that has Run only on pending entries selected.

    1. Select Additional filter and type the condition for the filter using the relevant fields from the Translation Entry fields. For best performance, this option is not recommended.

    Note: The filter defines on which entries the script is run. The final filter is a combination of the selected information.

    Available criteria fields are: FIELD_NAME_1, FIELD_NAME_2, FIELD_NAME_3, FIELD_NAME_4, FIELD_NAME_5.

    Those fields define the translation table in the T_TRANSLATION_DEFINITIONS table.

    Use those fields when writing a "where" clauses in an SQL query (without the "where").
    Example: FIELD_NAME_1 = 'val1' and FIELD_NAME_2 = 'val2'

    Note: When the translation script runs on new entries, it uses the used translation table entries only. The script ignores the other filter definitions.

    1. Click Check Additional Filter to check the syntax of the additional filter.

    If there is no error, a confirmation string is displayed. If there is an error, the reason for the error is displayed.

  4. In the Script tab:
    1. Enter the code for the script. A translation script toolbar, located above the Script area, enables performing additional functions on the script, as described in the following table:

Icon

Shortcut

Description

Save button

Ctrl-S

Saves the Translation Script text.

Cut button

Ctrl-X

Cuts selected Translation Script text.

Copy button

Ctrl-C

Copies selected Translation Script text to the clipboard.

Paste button

Ctrl-V

Pastes Translation Script text from the clipboard.

Find and Replace

Ctrl-F

Opens a pop-up window that enables you to find and replace Translation Script text.

Undo button

Ctrl-Z

Undoes the last editing action.

Redo button

Ctrl-Y

Repeats the action that was canceled by Undo.

Check Syntax

F7

Checks the Translation Script syntax.

List of Values button

Ctrl-J

Opens a pop-up window for choosing specific adapters, contract parties, event types, resources, resource groups, resource types, resource versions, resource version statuses, services, time zones, translation entry statuses(pending, translated, ignored, deleted), translation return types, translation tables, translation tables types(resource, event type, service, contract party, time zone and value).

Global objects: EntryDetails, SafeOdbc & Tools.

Toggle Full Screen Mode button

F11

Toggles between Normal and Full Screen views.

  1. Select Check Script on save to check the syntax of the script when a save is performed.
  1. Click Save to save the script.
  2. Click Cancel to discard changes and return to the previous page.

Note: Use features in the dialog to edit, delete, run, search, and view details for a translation script.

If you selected Far Eastern Languages, then you have the following icons:

Icon

Shortcut

Description

Save button

Ctrl-S

Saves the Translation Script text.

Check Syntax

F7

Checks the Translation Script syntax.

 

 

Select Check Script on save to check the syntax of the script when a save is performed.

Note: See the Administration Guide for instructions how to allow Far Eastern languages in BSI.