Managing Projects Using the Command Line

You can use the command line to export, update, and synchronize Lingo projects. With the command line, you do not have to open Lingo at all.

The best way to use the command line feature is to create a batch file with the necessary commands in it. Then you can use a scheduling tool (such as the Task Scheduler utility in Windows) to run the batch file automatically whenever you want.

How to Use the Command Line for Lingo Projects

  1. Open Notepad (to create and save a batch file) or open your command prompt (to run a command immediately).
  2. Type the path to the Lingo.app folder where you installed Lingo, and press ENTER.

    cd\Program Files\MadCap Software\MadCap Lingo 11\Lingo.app

    Note Alternatively, you can use cd c:\Program Files\[rest of the path] instead of cd\Program Files\[rest of the path].

  1. Type any of the following as part of your command, entering the appropriate value in place of the section in brackets:

    • -project [project file] Path and name of Lingo project.
    • -sourceFile [source file] Path and name of source project or file you are translating.
    • -exportTo [export path] Path where you want to store translated project or file after exporting from Lingo.
    • -syncProject [true/false] Used only if source file is listed along with project file; updates Lingo project with source file before exporting.
    • -language [target language or code] Language to which you are translating; can enter full language or code.
    • -appendLanguage [true/false] Used to apply a language code (e.g., "es" for Spanish) to exported non-project files, instead of applying code to folder.

      This is beneficial if you want to flatten the exported files so you can see them side by side, instead of having all instances of the same file name without any language code attached to those files.

    Tip Some operating systems allow you to drag a folder or file from the Windows location to the Command Prompt window. This will add the path of the folder or file within quotation marks for you.

    Note If there are spaces anywhere in the path/name of your project file, source file, export path, or target language, you need to use quotation marks around it.

    Note The commands used by the compiler are case-sensitive.

    To Export a Lingo Project

    Here is the command:

    lingoproject.exe -project [project file] -sourceFile [source file] -exportTo [export path] -syncProject [true/false]

    Example  

    You have a Lingo project called "Nursery Rhymes” that is stored in your Documents\My Translated Projects folder, and you want to export it to a folder on your Desktop. The source is a Flare project located in a folder called "SourceFiles" on your C drive. You would type this:

    lingoproject.exe -project "C:\Users\[username]\Documents\My Translated Projects\Nursery Rhymes.liprjf\Nursery Rhymes.liprj" -sourceFile "C:\SourceFiles\Nursery Rhymes.flprj" -exportTo "C:\Users\[username]\Desktop\Exports" -syncProject true

    To Export a Lingo Project in a Specific Language

    Here is the command:

    lingoproject.exe -project [project file] -sourceFile [source file] -exportTo [export path] -language [target language or code] -syncProject [true/false]

    Example  

    You have a Lingo project called "Nursery Rhymes" that has been translated into Spanish and French. It is stored in your Documents\My Translated Projects folder, and you want to export the Spanish version to a folder on your Desktop. The source is a Word document located in a folder called "SourceFiles" on your C drive. You would type this:

    lingoproject.exe -project "C:\Users\[username]\Documents\My Translated Projects\Nursery Rhymes.liprjf\Nursery Rhymes.liprj" -sourceFile "C:\SourceFiles\Nursery Rhymes.docx" -exportTo C:\Users\[username]\Desktop\Exports -language Spanish -syncProject true

    To Export a Lingo Project in All Languages

    If you wish to export all of the languages in your Lingo project using the command line, this is the syntax you would use:

    lingoproject.exe -project [project file] -sourcefile [source file] -exportTo [export path] -syncProject [true/false] -appendLanguage [true/false]

    Note Since the -language argument is omitted from this command, Lingo will export all languages in the project. The -appendLanguage argument of this command indicates that a language code will be used for the parent folder name for each of the exported languages of non-project files.

    Example  

    Say that you have a Lingo project called "San-Diego" that has been translated into Danish and Dutch. This project is stored in your Translated-Projects folder on your local C drive. The source Flare project file is also located on your C drive in the Source-Files folder. You want to export your project to a network location that is mapped to your S drive. You would first type the path to the Lingo.app folder where you installed Lingo. If you installed Lingo to the default location, you would type this and press ENTER on your keyboard:

    cd\Program Files\MadCap Software\MadCap Lingo 11\Lingo.app

    Next, type this and press ENTER on your keyboard:

    lingoproject.exe -project C:\Translated-Projects\San-Diego.liprjf\San-Diego.liprj -sourcefile C:\Source-Files\San-Diego.flprj -exportTo S:\Exported-Projects -syncProject true

    To Update a Lingo Project

    Here is the command:

    lingoproject.exe -project [project file] -sourceFile [source file]

    Example  

    You have a Lingo project called "Nursery Rhymes." It is stored in your Documents\My Translated Projects folder. Your source file has changed, so you want to update the Lingo project. The source is a Flare project located in a folder called "SourceFiles" on your C drive. You would type this:

    lingoproject.exe -project "C:\Users\[username]\Documents\My Translated Projects\Nursery Rhymes.liprjf\Nursery Rhymes.liprj" -sourceFile "C:\SourceFiles\Nursery Rhymes.flprj"

    Now What?

    If you are using the command prompt window for any of the commands just described, the project is exported or updated immediately.

    If you are creating a batch file in Notepad, it might look something like this:

Batch Files and Task Scheduler

If you are creating a batch file, save the Notepad file to any location you like on your computer. When you do this, type .bat as the extension at the end of the file name (e.g., MyBatchFile.bat). At any time you like, you can generate the output simply by double-clicking the batch file. You can also use a tool to schedule the batch file to run.

For example, complete the following steps if using the Windows 10 Task Scheduler utility.

  1. In the Windows search field, type Task Scheduler and press ENTER.
  2. Click Action > Create Basic Task.
  3. In the Create Basic Task Wizard, give the task a name and click Next.
  4. Using the next couple of pages of the wizard, choose when you wan the batch to run (e.g., daily, starting at 2 a.m.). Click Next until you get to the Action page.
  5. Click Start a program, and click Next.
  6. Click Browse. Then find and double-click the batch file you created.
  7. Click Next.
  8. Click Finish.

What’s Next?

After exporting a project, you can inform the author, who can then open the translated project or file and create output for it.

After updating a project, you can open a list of files that require translation (see Viewing Files Requiring Translation). If the Difference column indicates a change was made to a particular file, you can open that file to translate the new text (you may need to drag the divider in the File List window pane to see the Difference column).