Command Line Commands for "RWTCmd.exe"   [OBSOLETE]

Last update: March 2017

 

NOTE: The "RWTCmd.exe" command line tool used in previous versions (RC-WinTrans X8 through 10) has been replaced by the command line tool "RCWinTrans.exe" (the RC-WinTrans application) introduced with RC-WinTrans 11.

 

For the purpose of compatibility the "RWTCmd.exe" command line tool is still included with RC-WinTrans 11. It can be used with the command line commands described below.

 

Using the command line processing introduced with RC-WinTrans 11 is preferable and recommended.

 

The general synopsis of the RC-WinTrans (Version X8/9/10) command line tool ("RWTCmd.exe") command is as follows.

 

RWTCmd   (command)   [(params)]   [(switches)]

 


 

COMMANDS:

·

/AddLanguage

·

/AddProject and /RemoveProject
New in January 2012.

·

/AddSourceFile

·

/AddTextToLogFile

·

/CheckLanguage

·

/CreateProject

·

/ExportProject

(Exports a translation project.)

New in Sept. 2011.

< Example 1 >

< Example 2 >

·

/ImportFromProject

(Imports data from a project.)

Last update: Jan. 2012.

< Example 1 >

< Example 2 >

·

/ImportFromResourceFile

·

/IsProjectUpToDate

·

/IsTranslated   (New in January 2012.)

·

/IsUpToDate

·

/Update

·

/UpdateAll

·

/WriteTargetFile

·

/WriteAllTargetFiles

·

/WriteMultiLangTargetFile

SWITCHES:

·

/forceterminate

·

/help

·

/keepalive

·

/log

 

 

 

 

 

 

OTHER SUBJECTS:

FILE NAMES

RETURN VALUES

ERRORS

 


 

Commands

The following is an overview of the RC-WinTrans command line commands.  Sample files demonstrating the use of certain commands are included with RC-WinTrans.  These files can be found in the RC-WinTrans installation under "Samples" | "Commandline" | "Batch."

 

·

/AddLanguage

    /AddLanguage   (1. ProjectFileName)   (2. LangCode)
or
 /a ...

DESCRIPTION:

Adds a new target language to a translation project.

PARAMETERS:

1. ProjectFileName

Project file; the full path to the translation project file (.rwtproject).

2. LangCode

Target language; the language code for the language to add.

RETURN VALUE:

"0" when successful.

EXAMPLE:

rwtcmd.exe   /AddLanguage   "c:\dir\mytrans.rwtproject"   ja-JP   /a

rwtcmd.exe   /a   mytrans.rwtproject   "fr"

 

^ TOP ^

 

/AddProject              [New -- January 2011]
/RemoveProject        [New -- January 2011]

    /AddProject (1. ProjectFileName)  
or
 /ap ...

    /RemoveProject (1. ProjectFileName)  
or
 /rp ...

DESCRIPTION:

Adds/Removes a  translation project.to/from the RC-WinTrans environment
                                         (respective to/from the "Projects" tab view).

PARAMETERS:

1. ProjectFileName

Project file; the full path to the translation project file (.rwtproject).

 

RETURN VALUE:

"0" when successful.

EXAMPLE:

rwtcmd.exe   /AddProject   "c:\dir\mytrans.rwtproject"

rwtcmd.exe   /ap   "c:\dir\mytrans.rwtproject"

 

·

/AddSourceFile

    /AddSourceFile   (1. ProjectFileName)   (2. SourceFileName)
or
 /as ...

DESCRIPTION:

Adds a new source file to the translation project.

PARAMETERS:

1. ProjectFileName

Project file; the full path to the translation project file (.rwtproject).

2. SourceFileName

Resource file; the full path to the source file to be added.

RETURN VALUE:

"0" when successful.

EXAMPLE:

rwtcmd.exe   /AddSourceFile   "c:\dir\mytrans.rwtproject"   "c:\dir\files\app.rc"

rwtcmd.exe   /as   "c:\dir\mytrans.rwtproject"   "c:\dir\files\strings.ini"

 

^ TOP ^

·

/AddTextToLogFile

    /AddTextToLogFile   (1. text)
or
 /ll ...

DESCRIPTION:

Writes text as a single line to the log file.  See also the "/log" switch under "Switches" (further on).

PARAMETERS:

1. text

The string to write to the logging file.  Use quotation marks if the string contains spaces.

RETURN VALUE:

"0" when successful.

EXAMPLE:

rwtcmd   /AddTextToLogFile   "Hello World!"   /a

rwtcmd   /ll   "Start process from command line..."

 

^ TOP ^

·

/CheckLanguage

    /HasLanguage   (1. ProjectFileName)   (2. LangCode)
or
 /l ...

DESCRIPTION:

Checks the existence of a specified language in the translation project.

PARAMETERS:

1. ProjectFileName

Project file; the full path to the translation project file (.rwtproject).

2. LangCode

The language code for the language to be checked.

RETURN VALUE:

"1" if the project contains the specified language; otherwise "0."

EXAMPLE:

rwtcmd   /CheckLanguage   "c:\dir\mytrans.rwtproject"   it-CH

rwtcmd.exe   /l   "c:\dir\mytrans.rwtproject"   en-US

 

^ TOP ^

·

/CreateProject

    /CreateProject  (1. ProjectFileName)  (2. ProjectName)  (3. SourceLangCode)
or
 /c ...

DESCRIPTION:

Creates a new translation project.

PARAMETERS:

1. ProjectFileName

Project file; the full path to the translation project file (.rwtproject).

2. ProjectName

Short name of the translation project.  The name will be used/displayed in RC-WinTrans.

3. SourceLangCode

Source language; the language code for the source language of the translation project.

RETURN VALUE:

"0" when successful.

EXAMPLE:

rwtcmd.exe  /CreateProject  "c:\dir\mytrans.rwtproject"  "My Project1"  it-CH

rwtcmd.exe   /c   "c:\dir\mytrans.rwtproject"   "My Project1"   en-UK

 

^ TOP ^

·

/ExportProject

    /ExportProject   (1. ProjectFile)   (2. TargetProjectFile)   (3. SrcLang)
              (4. TgtLang)   (5. ProjectName- optional)
or
 /ep ...

DESCRIPTION:

Exports a translation project as database type project (.fsmdb file).  One target language from the source project can be exported, even if the source project has several target languages.

Hints: Use the "/log" switch to write command call information to a log file.

PARAMETERS:

1. ProjectFile

File name of the source project from which data is to be exported; file extension = *.rwtproject (project definition file).  The source project must be listed in RC-WinTrans' Projects tab view.

2. TargetProjectFile

File name of the target project; file extension = *.fsmdb (database file) or *rwtproject (project definition file).

3. SrcLang

The source language.  Use an empty string ("") when the source language is the project's original language.  To use an existing target language as the source language, use the language code of the target language.

4. TgtLang

Target language; the language code of the target language.

5. ProjectName  (Optional)

A short name for the project used in RC-WinTrans' Projects tab view.  This parameter is optional.  When this parameter is not given the exported project will have the same name as the source project.

RETURN VALUE:

"0" when successful.

EXAMPLE:

rwtcmd  /ExportProject  "main.rwtproject"  "Proj2.fsmdb"  ""  it-IT

rwtcmd   /ep   "main.rwtproject"   "Proj2.fsmdb" "en-US" " it-IT"  "ItalyCADAppl"

 

^ TOP ^

·

/ImportFromProject      (updated:  January 2012

    /ImportFromProject   (1. ProjectFile)   (2. FromProjectFile)
                  (3. FromLang)  (4. ToLang)  (5. ImportData optional)
or
 /ip ...

DESCRIPTION:

Imports data from a translation project for a single target language.

Hints:  Use the "/log" switch to write command call information to a log file.
The number of imported items is also reported to the log file.

PARAMETERS:

1. ProjectFile

File name of the project into which data is to be imported; file extension = *.rwtproject (project definition file).

2. FromProjectFile

File name of the project from which data is to be imported; file extension = *.fsmdb (database file) or *rwtproject (project definition file).

3. FromLang

The language code of the language for which data is to be imported, e.g., "en-US" for English (US) or "ja-JP" for Japanese (Japan).

4. ToLang

Target language; the language code of the target language for which data is to be imported.

5. ImportData  (Optional)

A numeric value for the data type(s) to import:

Text (= 1):  text.

Size (= 2):  size and position.

Binary data (= 4):  binary data, images.

Font (= 8):  font specification.

Style (= 16):  styles.

All other (= 32):  all other data.

Note (= 64):  notes (RC-WinTrans data).

Task (= 128):  tasks (RC-WinTrans data).

Re-check (= 256):  re-check marker (RC-WinTrans data).

When this optional parameter is not given the default value of "3" is used.  This imports text (1) and size/position" (2) = 3.

RETURN VALUE:

"0" when successful.

EXAMPLE:

rwtcmd /ImportFromProject  "main.rwtproject"  "Proj2.fsmdb" "it" " it-IT"  3  /log "log.txt"

rwtcmd /ip   "main.rwtproject"   "Proj2.fsmdb"  "en-US"  "en" 259   /log "log.txt"

 

^ TOP ^

·

/ImportFromResourceFile

    /ImportFromResourceFile  (1. ProjectFileName)  (2. LangCode)  (3. ToResFile)
(4. FromResFile)  [5. DataType]  [6. ImportSameAsSource]

or
/ir ...

DESCRIPTION:

Imports the data of a translated resource file for a corresponding file in a translation project.

PARAMETERS:

1. ProjectFileName

Project file; the full path to the translation project file (.rwtproject).

2. LangCode

Target language; the language code of the data.

3. ToResFile

The full path to the source file as contained in the translation project.

4. FromResFile

The full path to the translated resource file.

5. DataType

The data type(s) to be imported; possible values:

"ALL" = import all data.

"STRING" = import strings only.

"SIZE" = import size and position data only.

NOTE:  The use of this parameter is optional.  The default value is "ALL."

6. ImportSameAsSource

Import translated text data even if the text is identical to the source text.

Possible values:

1 = import text also if it is the same as the source text

0 = import text only if it is different to the source text

NOTE:  The use of this parameter is optional.  The default value is "0."

RETURN VALUE:

"0" when successful.

EXAMPLE:

rwtcmd  /ImportFromResourceFile  "mytrans.rwtproject"  en-US  "files\app.rc"  "files\it\appIT.rc"

rwtcmd   /ir   "mytrans.rwtproject"  en-US  "files\app.rc" "files\it\appIT.rc"   SIZE  /a

rwtcmd   /ir   "mytrans.rwtproject"   en-US   "files\app.exe" "files\it\app.exe"   STRING  1   /a

 

^ TOP ^

·

/IsProjectUpToDate

    /IsProjectUpToDate   (1. ProjectFileName)   (2. TargetLangCode)
or
 /pd ...

DESCRIPTION:

Verifies whether any of the source files in a translation project have changed when compared to the translation project (i.e., whether the files need to be updated).  This check is only performed for the project file with the given target language.

PARAMETERS:

1. ProjectFileName

Project file; the full path to the translation project file (.rwtproject).

2. TargetLangCode

Target language; the language code for the language to be checked.

RETURN VALUE:

"1" if the translation project is up-to-date for the specified language; otherwise "0."

EXAMPLE:

rwtcmd   /IsProjectUpToDate   "mytrans.rwtproject"   en-US   /a

rwtcmd   /pd   "mytrans.rwtproject"   ja-JP   /a

 

^ TOP ^

·

/IsTranslated              (updated:  January 2012

 /IsTranslated  (1. ProjectFile) (2. TargetLangCode) (3. SourceFile optional)
or
 /t ...

DESCRIPTION:

Verifies whether a given source file contained in a translation project is translated for the specified language.  A file is considered to be translated when a translation (target text) exists for all text items (e.g. caption, string, x-text, comboboxitem, listitem).

PARAMETERS:

1. ProjectFile

Project file; the full path to the translation project file (.rwtproject).

2. TargetLangCode

Target language; the language code for the language to be checked.

3. SourceFile  (Optional)

The full path to the source file to be checked.

This parameter is optional and can be omitted to check the data for all files in the project (for the given target language)

RETURN VALUE:

"1" if the project is translated for the specified language; otherwise "0."

EXAMPLES:

rwtcmd   /IsTranslated   "c:\transl\mytrans.rwtproject"   de-DE   "c:\trans\resfile.resx"  /a

rwtcmd   /t   "c:\transl\mytrans.rwtproject"   ja-JP   "c:\trans\resfile.resx"   /a

rwtcmd   /IsTranslated    "c:\transl\mytrans.rwtproject"   ja-JP   /a

 

^ TOP ^

·

/IsUpToDate

    /IsUpToDate  (1. ProjectFileName)  (2. SourceFileName)  (3. TargetLangCode)
or
 /d ...

DESCRIPTION:

Checks whether a given source file has changed by comparing it to the translation project.  This check is only performed for the project file with the given target language.

PARAMETERS:

1. ProjectFileName

Project file; the full path to the translation project file (.rwtproject).

2. SourceFileName

The full path to the source file to be checked.

3. TargetLangCode

Target language; the language code for the language to be checked.

RETURN VALUE:

"1" if the source file is unchanged; otherwise "0."

EXAMPLE:

rwtcmd   /IsUpToDate   "c:\transl\mytrans.rwtproject"   de   "c:\trans\resfile.resx   /a

rwtcmd   /d   "mytrans.rwtproject"   ja-JP   "resfile.resx"   /a

 

^ TOP ^

·

/Update

    /Update   (1. ProjectFileName)   (2. SourceFileName)   (3. TargetLangCode)
or
 /u ...

DESCRIPTION:

Updates the translation data of a source file for a given target language.

PARAMETERS:

1. ProjectFileName

Project file; the full path to the translation project file (.rwtproject).

2. SourceFileName

Resource file; the full path to the source file to be updated.

3. TargetLangCode

Target language; the language code for the language to be updated.

RETURN VALUE:

"0" when successful.

EXAMPLE:

rwtcmd  /Update  "c:\transl\mytrans.rwtproject"  "c:\trans\resfile.resx"  it-IT  /a

rwtcmd   /u   "mytrans.rwtproject"   "resfile.resx"   ja-JP   /a

 

^ TOP ^

·

/UpdateAll

    /UpdateAll   (1. ProjectFileName)   (2. TargetLangCode)
or
 /ua ...

DESCRIPTION:

Updates all the translation data of the source files in a translation project for a given target language.

PARAMETERS:

1. ProjectFileName

Project file; the full path to the translation project file (.rwtproject).

2. TargetLangCode

Target language; the language code for the language to be updated.

RETURN VALUE:

"0" when successful.

EXAMPLE:

rwtcmd   /UpdateAll   "mytrans.rwtproject"   it-IT   /a

rwtcmd   /ua   "c\transl\mytrans.rwtproject"   ja-JP   /a

 

·

/WriteTargetFile

    /WriteTargetFile (1. ProjectFileName) (2. SourceFileName) (3. TargetLangCode)
    (4. TargetFileName) [5. Encoding]

or
 /wt ...

DESCRIPTION:

Writes a target file in a specified language with the optional use of a given encoding (e.g., "default," "UTF-8," or "UTF-16" for Java properties files). Note that if the "TargetFileName" parameter is passed as an empty string (""), the target file rule designated for the project file will be used.

PARAMETERS:

1. ProjectFileName

Project file; the full path to the translation project file (.rwtproject).

2. SourceFileName

Resource file; the full path to the source file.

3. TargetLangCode

Target language; the language code for the target language to use.

4. TargetFileName

The full path and name of the target file to be written (created).  An empty string ("") uses the default target file name.

5. Encoding

(Optional) Character encoding; the string containing the encoding to use, e.g., "default," "UTF-8," or "UTF-16."

NOTES:  This parameter is optional.  Also, the encoding is only used for text files and Java properties files- otherwise the given encoding is ignored.

RETURN VALUE:

"0" when successful.

EXAMPLE:

rwtcmd  /WriteTargetFile  "mytrans.rwtproject"  "files\app.rc"  it-IT  "files\it\appIT.rc  "UTF-16" /a

rwtcmd   /wt   "mytrans.rwtproject"   "files\app.ini"   it-IT   "files\app-italy.ini   "UTF-16"   /a

rwtcmd   /wt   "mytrans.rwtproject"   "files\strings.dll"   it-IT   "files\strings-italy.dll

 

^ TOP ^

·

/WriteAllTargetFiles

    /WriteAllTargetFiles  (1. ProjectFileName)  (2 TargetLangCode)  [Encoding]

or  /wa ...

DESCRIPTION:

Writes all target files of a translation project with the optional use of a given encoding (e.g., "default," "UTF-8," or "UTF-16" for Java properties files).  If the encoding value cannot be applied to a given file type, it will be ignored.  The target files will be written according to the target path rules specified for the translation project.

PARAMETERS:

1. ProjectFileName

Project file; the full path to the translation project file (.rwtproject).

2. TargetLangCode

Target language; the language code for the target language to use.

3. Encoding

(Optional) Character encoding; the string containing the encoding to use, e.g., "default," "UTF-8," or "UTF-16."

NOTES:  This parameter is optional.  Also, the encoding is only used for text files and Java properties files- otherwise the given encoding is ignored.

RETURN VALUE:

"0" when successful.

EXAMPLE:

rwtcmd   /WriteAllTargetFiles   "mytrans.rwtproject"   zh-TW   /a

rwtcmd   /wa   "mytrans.rwtproject"   zh-TW

 

^ TOP ^

·

/WriteMultiLangTargetFile

    /WriteMultiLangTargetFile   (1. ProjectFileName)   (2. SourceFileName)
(3. TargetLangCodes)   (4. TargetFileName)   [Encoding]

or
 /wmt ...

DESCRIPTION:

This command can only be used only to write Win32 EXE/DLL multiple-language target files.

PARAMETERS:

1. ProjectFileName

Project file; the full path to the translation project file (.rwtproject).

2. SourceFileName

Resource file; the full path to the source file.

3. TargetLangCodes

The target language codes to use- one or more target languages separated by commas.  The parameter (list of language codes) must be contained in apostrophes (example: "en-US, de, ja-JP").

4. TargetFileName

The full path and name of the target file to be written (created).  An empty string ("") uses the default target file name.

5. Encoding

NOT USED (August 2007).

RETURN VALUE:

"0" when successful.

EXAMPLE:

rwtcmd.exe   /WriteMultipleLangTargetFile   "MyApp.rwtproject"   MyApp.EXE   "it, de, fr"   MyApp-MultiLang.EXE

rwtcmd   /wmt   "MyApp.rwtproject"   MyApp.EXE   "zh-TW, ja-JP"  MyApp-MultiLang.EXE

 

A sample project  can be found in RC-WinTrans' "Samples" folder:

\Samples\Translation\ScribbleMultiLangEXE\ScribbleMultiLangExe.rwtproject

 

The sample includes a batch file "WriteTgt.bat" to write the English Win32 source file "ScribbleUC.exe" as a multiple-language EXE file with the following languages: English (source), German, and Japanese.

 

^ TOP ^

 

 

Switches

A switch is added to a command to modify the command's behavior.  Switches may be any (logical) combination of the following:

 

/forceterminate
/
xs

 

DESCRIPTION:

Terminates the RC-WinTrans application without executing a command.

WARNING:  This switch should only be used if there has already been an instance in which RC-WinTrans has crashed.  This switch will try to KILL the RC-WinTrans process.  DO NOT use this switch unless there is a serious problem.


 

^ TOP ^

/help
/
h
/
?

 

DESCRIPTION:

Displays usage information.


 

^ TOP ^

/keepalive
/
a

 

DESCRIPTION:

Keeps the RC-WinTrans server running after the execution of a command.  Without this switch, the RC-WinTrans application will shut down after the command has been processed.

SAMPLE FILE:

"CreateProject.bat"


 

^ TOP ^

/log (logfile)

 

DESCRIPTION:

Writes intermediate output to the log file.

SAMPLE FILE:

"CreateProject.bat"


 

^ TOP ^

/macro (name of VBA user macro for the command dispatcher)

 

DESCRIPTION:

Specifies a VBA macro other than "SystemMacros" in case you have your own command dispatcher function.


 

^ TOP ^

/module (name of VBA module for the command dispatcher)

 

DESCRIPTION:

Specifies a VBA macro module other than "CommandLine" in case you have your own command dispatcher function.  Note that the dispatcher always calls the function "DispatchCommandLineCall()" within this module.  The synopsis is as follows:

Function DispatchCommandLineCall(ByRef Parameters() As Variant) As Long

The command line arguments are passed as a (zero-based) array of variants.


^ TOP ^

 

 

File Names

File names (e.g., "RWTProjectFileName"; "SourceFileName"; "TargetFileName") may have complete or relative file paths, as in:

·

c:\trans\my.rwtproject

·

source.dll

·

...\target.dll

 

 

Return Values

A non-negative return value indicates a successful operation.

A negative return value always indicates an error.

 

 

Errors

 

 

ERROR

DESCRIPTION

7000

Invalid parameters.

7001

The project was not found.

7002

There is no valid log file.

7003

There is no valid source language.

7004

There is no valid target language.

7005

The RC-WinTrans project file already exists.

7006

The project file could not be created.

7007

The language could not be added.

7008

There is no valid RC-WinTrans project file name.

7009

The source file does not exist.

7010

The source file was not added.

7011

An error occurred while creating the project.

7012

The project file was not found.

7013

The languages for the project file could not be loaded.

7014

The target file name is invalid.

7015

The target file could not be written.

7016

The source file has not changed.

7017

The update failed.

7018

There is no valid Java target file encoding.

7019

The target encoding for the data type is not allowed.

7020

"Name" is a mandatory parameter.

7021

The is-up-to-date check failed.

7022

The has-language check failed.

7023

The is-translated check failed.

7024

The import from target file failed.

7025

The target file does not exist.

7026

"ParamValue" is not a valid resource type.

 

 

^ TOP ^