Writes all target files or one single (translated) target file in the specified language.
The target file name rule and the target file encoding designated in the project will be used. By default, a target file is written when it is outdated - otherwise it is skipped.
To force all target files to be written anew, use the parameter forceAll (=True).

Syntax:

WritergetFile(pojFile As String, SrcFile As String, TgtFile As String, 
              Lang As String, LogFile As String forceAll AS Boolean ) As long 
Return: long
The number of target files written successfully.

Note on error(s): The information that a target file could not be written is not returned with the return value.
Use the Error object to check if there was an error and if a file could not be written.
See the example below.

Parameters:
pojFile As String
Project file name; the full path to the translation project file (.rwtproject)
or the project database file (.fsmdb).

SrcFile As String (can be empty)
Source file; the source file name to write a target file for.
The string can be the full path plus the file name, or only the file name.
Note: Use an empty string to apply to write the target files for all source files.

TgtFile As String (can be empty)
Target file; the file name for the (translated) target file.
Options:
a) use the full path plus the file name;
b) use only the file name to write to the same location as the source file; or
c) use an empty string to use the target file name as specified in the translation project.

The parameter is ignored when the 'srcFile' parameter is empty.

Lang As String
Target language; the language code for the language to be used.

LogFile As String (can be empty)
File name; the name of the log file to which processing information is written.

forceAll As Boolean
True: Forces all target files to be written.
False: Writes a target file only when the target file doesn't exist or when it is outdated.

Example:

Dim Proj As TranslationProject
Dim nFiles As long

Set Proj = RCWinTrans.OpenGetProject("MyProj.fsmdb", "ch_CHS", False)
nFiles =  Proj..WriteTargetFile("","", "ch-CHS","",True) 

If RCWinTrans.Errors.Count > 0 Then
   MsgBox RCWinTrans.Errors.LastError
End If

See also:

Class TranslationProject


Last Updated: 03/20/21