Importing translations from the command line (askiatranslator)

Note: This functionality is available from version 5.4.

It is possible to import translated question captions from the command line. The process returns either the number of strings (if no errors occurred), or error codes (if errors occurred).

In this topic:

Location and file name

If you are using askiasuite version 5.4.4 or earlier, the application path is %programfiles(x86)%AskiaTranslatorU.exe.

If you are using askiasuite version 5.4.5 or later, the application path is %programfiles(x86)%AskiaTranslator.exe.

Parameters

The following command-line parameters are available (note that the first two parameters are mandatory):

Parameter Type Description
[None] String This is a required parameter. Specifies the path of the survey file. This parameter accepts QES, QEW, QEX or XML file types only.
/translate String

This is a required parameter. Indicates the path and name of the translation file.

/copyidentical Boolean

If this flag is present, the translation provided for each text string will be applied to to all identical instances of that text string found in the QES, where these other instances have not been provided with their own translations (for the language being imported). For example, if the phrase "Please select all that apply" is used in five questions, but is translated once, that translation will be copied to all five instances in the QES. To match strings, askiatranslator will use the original captions and not the question/response IDs.

/importunchanged Boolean

Use this parameter if any texts have changed in your QES since you exported the translations, and you want to avoid over-writing them with translations. In other words, if any strings have changed in the QES since the export, they will not be over-written as the corresponding translations will not be imported.

/reference String Abbreviation or ID of the language used for copying the strings when specifying copyidentical or importunchanged.
/export String The name of the output file.
/excludenonvisible Boolean If this flag is present, questions which are not visible during data entry will be excluded.
/excluderouting Boolean If this flag is present, routings will be excluded.
/excludemessage Boolean If this flag is present, system messages will be excluded.
/excludetranslated Boolean If this flag is present, strings which are already translated will be excluded.
/excludeduplicates Boolean If this flag is present, duplicate strings will be excluded.
/headers String Comma-separated list of names for headers in the export file. For example: /headers:"English,French,Spanish"
/languages String Comma separated list of Language IDs to import or export. For example: /languages:"2057,1036"

 

Error codes

If the import process results in an error, you will receive one of the following error codes:

Code Description
-1 Cannot read the survey file
-2 Cannot save the survey file
-10 Cannot open the translation file
-11 Invalid translation file: file is empty
-12 Invalid translation file: file is not tab delimited
-13 Invalid translation file: Question ID not found
-14 Invalid translation file: Response ID not found
-15 Invalid translation file: Language not found in header
-16 Invalid translation file: Language not recognised in header
-17 Invalid translation file: Language ID not recognised
-18 Invalid translation file: Language not in survey
-19 Invalid translation file: Reference language not found
-20 Export file could not be created

 

Examples

The following examples are colour-coded, so you can see which part of the command-line corresponds to which part of the task we want to carry out.

Suppose we wanted to export the English and French translations from a qex file called EX2000.qex, excluding system messages, and with the headers “Question, Response, English, French”. We would enter the following at the command line:

TranslatorU.exe "C:QesMeTranslateEX2000.qex" /export:"C:QesMeTranslateTranslation.txt" /excludemessage /headers:"Question,Response,English,French" /languages:"2057,1036" (but see note below)

Suppose we wanted to import all English translations from Translation.txt into a qex file called EX2000.qex while avoiding over-writing any texts that have been changed in the QES since the texts were exported. We would enter the following at the command line:

TranslatorU.exe "C:QesMeTranslateEX2000.qex" /translate:"C:QesMeTranslateTranslation.txt" /importunchanged /reference:ENU (but see note below)

Note: If you are using askiasuite version 5.4.5 or later, the application name is Translator.exe.
Create your own Knowledge Base