Batch Mode Commands
This chapter describes the commands available in batch mode in SDL Passolo. The syntax descriptions use square brackets [] to indicate optional parameters. Expressions in angle brackets <> are placeholders for text arguments.
Each command begins with a slash (/) or a minus sign (-). Subsequent expressions without a slash or minus sign are parameters of the preceding command. Parameter containing spaces have to be set in quotation marks ("my project.lpu").
You can enter multiple commands in one line, until the maximum length of a command line is reached. When entering numerous commands in sequence, use of the /script command is recommended.
/addlang
Adds target languages to the current project. If the language to be added already exists in the project, it is not added again unless the ignoreexisting parameter is used.
- Syntax
-
/addlang[:] [lang:] [ignoreexisting]
- Parameters
-
lang:<languagename> Specifies the new language. <languagename> can be the language name in English ("German"), the language code ("deu") or the language ID ("07"). If only one language is added, the languagename parameter can be entered directly after the addlang command ignoreexisting Use this parameter to add a language to the project even if it already exists as a target language.
- Example
pslcmd c:\projects\myProject.lpu /addlang:"deu"
- /addsource
- Adds source files to the current project. If the source file to be added already exists in the project, it is not added again unless the ignoreexisting parameter is used.
- Syntax
-
/addsource[:] [sourcefile:] [sourcefilelist:] [sourcefolder:] [subfolders] [sourcelang:] [parser:] [targetrule:] [forcetargetrule:<name>] [ignoreexisting]
- Parameters
-
sourcefile:<filepath> Specifies the new source file. You can use multiple sourcefile parameters in order to add further source files. sourcefilelist:<filepath> <filepath> is a text file containing a list of the source files to be added to the project. sourcefolder:<folderpath> Specifies a folder containing source files. All the files in this folder are added to the project. If the subfolders parameter is used, all the files contained in subfolders of the source folder are also added. If you specify a parser only files that have one of the filename extensions supported by the given parser will be added. sourcelang:<languagename> Specifies the language of the strings in the source files. <languagename> can be the language name in English ("German"), the language code ("deu") or the language ID ("07"). (See Language IDs) parser:<parser> Specifies the parser to be used for the added source files. <parser> can be one of the following entries: Win32, AddIn:<identifier> or Macro:<filename> . The add-in identifiers are indicated in the Passolo add-in administration, e.g. Borland Delphi/C++ Builder or Microsoft .NET Parser. Please make sure that the identifier is entered correctly. targetrule:<name> Specifies the target rule to be used for the new source files. If no rule is specified, the standard rule is used. The specified rule can be overwritten by the parser of the source file. forcetargetrule:<name> Specifies the target rule to be used for the new source files. The specified rule is also used, if the parser defines an own target rule. ignoreexisting Use this parameter to add a source file to the project even if it already exists.
- Example
- Adds all the Delphi programs in c:\sources to the project.
/batch
This command is a combination of the /update and /generate commands. The string lists are updated, and then the target files are generated. Use the /source command to limit the operation to specified source files.
This command ensures compatibility with previous versions of Passolo. Current batch files should make use of the /update and /generate commands.
- Syntax
-
/batch
- Parameters
- <none>
- Example
- Updates all the string lists of a project and generates the target files
/check
Performs a validation of text lists.
- Syntax
-
/check [source:<Title>] [sourcefile:<File Path>] [nosource] [lang:<languagename>] [notrans] [id:<id>]
- Parameters
-
source:<title> Specifies a source string list to be updated (based on the title). If you do not indicate a language and do not use the notrans parameter, all the corresponding translation lists are also checked. sourcefile:<filepath> Specifies a source string list to be updated (based on the file path). If you do not indicate a language and do not use the notrans parameter, all the corresponding translation lists are also checked. nosource With this parameter the checking of source string lists is prevented. lang:<languagename> If you specify a language, all translation string lists in this language are checked. <languagename> can be the language name in English ("German"), the language code ("deu") or the language ID ("07"). notrans With this parameter the checking of translation lists is prevented. id:<id> Specifies the string list to be updated based on the ID. If this is a source string list and you do not indicate a language and do not use the notrans parameter, all the corresponding translation lists are also checked. /closeproject
Closes the last opened project. This command should always be performed for each project when multiple projects are processed in a /script command.
- Syntax
-
/closeproject
- Example
-
Two projects are processed in a /script command and the first one is closed before starting with the second one.
/openproject:c:\myFirstProject.lpu /update /closeproject /openproject:c:\mySecondProject.lpu /update
/generate
Generates target files
- Syntax
-
/generate [source:<title>] [sourcefile:<filepath>] [lang:<languagename>] [id:<id>] [altfile:<filepath>] [altfolder:<folderpath>] [subfolders]
- Parameters
-
source:<title> Specifies a source file by means of its title. If you do not indicate a language, all the target files for this source file will be generated. sourcefile:<filepath> Specifies a source file by means of its file path. If you do not indicate a language, all the target files for this source file will be generated. lang:<languagename> If you indicate a language, only the target files for this language are generated. <languagename> can be the language name in English ("German"), the language code ("deu") or the language ID ("07"). id:<id> Specifies a target file by means of the corresponding ID in the translation list. altfile:<filepath> If only one target file is to be generated, you can specify an alternative path for the generated file. altfolder:<folderpath> You can specify an alternative folder for the generated target file. Use the subfolders parameter to generate subfolders within this folder according to the folder structure of the target files defined in the project. subfolders see altfolder parameter ifrequired If this parameter is set, only the required target files are generated. I.e. the target files whose translation lists have been modified since the last generation.
- Example
-
Generates all target files
psl c:\projects\myProject.lpu /generateGenerates all target files for German
psl c:\projects\myProject.lpu /generate lang:German
/output
Specifies a text file to which the Passolo messages generated during the batch operation are written.
- Syntax
-
/output:<outputfile> [append] [open]
- Parameters
-
append If you use this parameter, the output is appended to the existing output file. Otherwise the existing file is overwritten. open After Passolo ends, the output file is displayed in Notepad.
- Example
-
All messages are appended to c:\output.txt.
pslcmd c:\projects\myProject.lpu /batch /output:c:\output.txt append
/openproject
Opens an existing project. This command is not required if you specify the project before the first command. If a project is opened using /openproject, all subsequent commands in the batch file refer to this project.
- Syntax
-
/openproject:<projectpath> [normal|sharedSetup|sharedTranslate|sharedReadOnly]
- Parameters
-
<projectpath> Path of the project to be opened. You can also enter just the project name (without the path). In this case, Passolo will look for the project in the current directory and in the list of recently opened projects. normal This is the default mode. Only one user can open the project. He can modify all settings and data as needed. sharedSetup The project is opened in Shared Mode. The user can modify project settings and edit string lists. Only one user at a time can work in this mode. sharedTranslate The project is opened in Shared Mode. The user can edit string lists. sharedReadOnly The project is opened in Shared Mode. The user can view the string lists but cannot make changes.
- Example
- Updates the string lists in two projects. The first project is loaded via the standard command line parameter, the second using the /openproject command.
psl c:\projects\myProject.lpu /update /openproject:c:\projects\anotherProject.lpu /update
- /options
- Saves or loads an option profile.
- Syntax
-
/options:<profilename> [load|save|temp] [content:<profilecontent>]
- Parameters
-
<profilename> The profile name or the path to the options file (see Setting Options) load The options are loaded and saved persistently save The current options are saved in the profile / the specified options file. temp The options are loaded temporarily. The are only used for the current batch operation. content Only the specified options are saved or loaded. <profilecontent> is a comma-separated list of values corresponding to the pages of the Options dialog: view filter toolbars listops transdlg languages leverage pretrans fuzzy concordances terminology replicates assistant check spellcheck binaries simulation sytemmacro batch users system system2 folders If the parameter is missing all options are loaded or saved.
- Example
-
The view and check options are saved to the myOptions profile
pslcmd /options:myOptions save content:view,check
/quit
- Syntax
-
/quit
- Example
-
pslcmd /runmacro=MyMacro.bas /quit
- /runmacro
- Defines macro that is started.
- Syntax
/runmacro=<macro file>
- Parameters
-
<macro file> Name of the macro file. This macro must exist in the macro folder of Passolo. (See System Folder)
- Example
pslcmd /runmacro=MyMacro.bas /quit
/simulate
- Syntax
-
/simulate [source:<title>] [sourcefile:<filepath>] [lang:<languagename>] [id:<id>] [altfile:<filepath>] [altfolder:<folderpath>] [subfolders]
- Parameters
-
source:<title> Specifies a source file by means of its title. If you do not indicate a language, all the target files for this source file will be generated. sourcefile:<filepath> Specifies a source file by means of its file path. If you do not indicate a language, all the target files for this source file will be generated. lang:<languagename> If you indicate a language, only the target files for this language are generated. <languagename> can be the language name in English ("German"), the language code ("deu") or the language ID ("07"). id:<id> Specifies a target file by means of the corresponding ID in the translation list. altfile:<filepath> If only one target file is to be generated, you can specify an alternative path for the generated file. altfolder:<folderpath> You can specify an alternative folder for the generated target file. Use the subfolders parameter to generate subfolders within this folder according to the folder structure of the target files defined in the project. subfolders see altfolder parameter store A new target language is added to the project for the simulated translations. If the parameter store is indicated, the parameters altfile , altfolder and subfolders are ignored.
- Example
-
Generates simulated translations for all target files
pslcmd c:\projects\myProject.lpu /simulateGenerates simulated translations for all target files in German using the options from an options file.
pslcmd c:\projects\myProject.lpu /options:my_simulation_options temp /simulate lang:German
/newproject
- Syntax
-
/newproject:<projectpath>
- Parameters
-
<projectpath> Path of the project to be created
- Example
-
Sets up a new project and adds a source file
pslcmd /newproject:c:\projects\newProject.lpu /addsource sourcefile:c:\test\example.exe
/report
- Syntax
-
/report:%specificPath%
- Parameter
-
%SpecificPath% Specifying a location parameter (-report:%SpecificPath%) creates the reports inside the specified folder. No parameter The -report command creates timestamped folders containing corresponding reports inside the Reports subfolder of the project directory.
- Example
-
Creates folders named with the current date and hour that contain report files inside the specified location.
pslcmd /report:%c:\projects\myProject%
/script
Reads commands from a text file. The text file may contain any of the supported Passolo batch commands except for a further /script command. Lines beginning with a semicolon ; are regarded as comments and are ignored in batch processing.
- Syntax
-
/script:<scriptfile>
- Parameters
-
<scriptfile> Path to the script file
- Example
-
Executes all the commands in the file updateAll.txt.
pslcmd /script:c:\projects\updateAll.txt
- /source
- This command is used only in combination with the /batch command. It restricts the batch operations to the specified source file.
- Syntax
/source
- Parameters
- <none>
- Example
-
Updates all the string lists for Notepad and generates the corresponding target files.
pslcmd c:\projects\myProject.lpu /batch /source:notepad
- /synchronizeexports
-
Used with Collaboration Edition, it synchronizes the exported bundles from the configured FTP server with the current project. (see Synchronizing Translation Bundles)
The synchronization process consist in uploading a small bundle with differences to the FTP server and is downloading new translations from the FTP server into the current project.
- Syntax
- /synchronizeexports
- Example
-
Synchronizes the exported bundles with the project
pslcmd c:\projects\myProject.lpu /synchronizeexports
- /translate
-
Pre-translates with the current providers and options. See Options for Pre-Translation.
- Syntax
- /translate [source:<Title>] [sourcefile:<filepath>] [lang:<languagename>] [id:<ID>]
- Parameter
-
source:<Title> Specifies a source list to be updated based on the title. If you do not specify a language, all associated translation string lists are translated. sourcefile: Specifies a source list to be updated based on the source file path. If you do not specify a language, all associated translation string lists are translated. lang:<language> If you specify a language, all translation string lists in this language are translated. can be the language name in English ("German"), the language code ("deu") or the language ID ("07"). id:<id> Specifies the string list to be updated based on the ID. If you are dealing with a source list and you do not specify a language, all associated translation string lists are translated.
- Example
-
Pre-translates the German translation string list for the source notepad.
pslcmd c:\projects\myProject.lpu /translate source:notepad lang:GermanPre-translates all German translation string lists for this project.
pslcmd c:\projects\myProject.lpu /translate lang:German
- /update
- Updates the source string lists and translation lists.
- Syntax
/update [source:<title>] [sourcefile:<filepath>] [altsourcefile:<filepath>]
- Parameters
-
source:<Title> Specifies a source list to be updated based on the title. If you do not indicate a language and do not use the notrans parameter, all the corresponding translation lists are also updated. sourcefile:<filepath> Specifies a source list to be updated based on the source file path. If you do not indicate a language and do not use the notrans parameter, all the corresponding translation lists are also updated. altsourcefile:<filepath> If just one source string list is updated (e.g. by indicating a source parameter), you can specify an alternative source file to be read instead of the file given in the project settings. nosource With this parameter the update of source string lists is prevented. lang:<languagename> If you indicate a language, only the translation lists for this language are updated. <languagename> can be the language name in English ("German"), the language code ("deu") or the language ID ("07"). notrans With this parameter the update of translation lists is prevented. id:<id> Specifies the string list to be updated based on the ID. If this is a source string list and you do not indicate a language and do not use the notrans parameter, all the corresponding translation lists are also updated. ifrequired If this parameter is set, only the required text lists are updated. I.e. the text lists whose source files or respectively source lists have been modified since the last generation.
- Example
-
Updates the source string list for Notepad and the corresponding German translation list.
pslcmd c:\projects\myProject.lpu /update source:notepad lang:GermanUpdates all the source string lists
pslcmd c:\projects\myProject.lpu /update notransUpdates the source string list for Notepad using an alternative source file
pslcmd c:\projects\myProject.lpu /update source:notepad altsourcefile:"c:\examples\notepad.exe"
- /writeoutput
-
Writes a line of text to the output window Translation and, if specified, the output file (see /output)
- Syntax
- /writeoutput:<textline>
- Example
-
All messages are appended to c:\output.txt.
pslcmd c:\projects\myproject.lpu /writeoutput:"Start batch" /batch /writeoutput:"Batch ended" /output:c:\output.txt append