Appendix D


Command-file syntax

A command-file is an ordinary text file containing commands that you want the program to execute. Each command must appear on it's own line in the file. Empty and unrecognized lines are silently skipped (this is a good way to add comments). Commands must appear as the first item (i.e no whitespace or other characters) on the line. Parameters to the command are separated by one or more whitespace characters between the command and parameter. Commands are executed sequentially from top to bottom. Commands are not case-sensitive.

The following commands are recognized by the program:

 

Command Description
OPENORIG <filename> Opens <filename> as the original file. The file is interpreted as ANSI using the current user codepage.
OPENORIGUC <filename> Opens <filename> as the original file. The file is interpreted as Unicode.
OPENORIGUTF8 <filename> Opens <filename> as the original file. The file is interpreted as UTF-8.
OPENTRANS <filename> Opens <filename> as the translation file. The file is interpreted as ANSI using the current user codepage.
OPENTRANSUC <filename> Opens <filename> as the translation file. The file is interpreted as Unicode.
OPENTRANSUTF8 <filename> Opens <filename> as the translation file. The file is interpreted as UTF-8.
OPENDICT <filename> Opens <filename> as the dictionary file
SAVETRANS <filename> Saves the content of the translation column to <filename>. The file is saved in ANSI format using the current codepage. If <filename> already exists, it will be overwritten
SAVETRANSUC <filename> Saves the content of the translation column to <filename>. The file is saved in Unicode format. If <filename> already exists, it will be overwritten
SAVETRANSUTF8 <filename> Saves the content of the translation column to <filename>. The file is saved in UTF-8 format. If <filename> already exists, it will be overwritten
SAVEDICT <filename> Saves the content of the loaded dictionary to <filename>. If <filename> already exists, it will be overwritten
CREATEDICT Creates a dictionary from the currently loaded original and translated files without clearing the dictionary first. To clear the dictionary, call CLEARDICT first
CLEARDICT Clears the loaded dictionary
USEDICT Translates all empty items in the translation column using the currently loaded dictionary
INVERTDICT Inverts the currently loaded dictionary
QUIT Closes the program. If the QUIT command is omitted, all commands will be executed but the program will stay loaded after it is finished.

Note:

If you don't specify any files to open (by using OPENORIG, OPENTRANS or OPENDICT), the program will load the files from the last time you ran it.

 

Below is an example of a command-file that loads some files and a dictionary and then uses the dictionary to translate the file, saves the translation using a new name and then quits. Note that it uses relative, absolute and UNC paths.

OPENORIG  ..\languages\english.lng
OPENTRANSUC  X:\Translations\polish.lng
OPENDICT  Dictionaries\en_po.dct
USEDICT
SAVETRANSUTF8 \\DOMAINSERVER\Translations\Polish\polish2.lng
QUIT