LRM commands FAQ

From Lingoport Wiki
Jump to: navigation, search

Resource Manager Command Line Client

The Command Line Client allows you to interact with the resource files and to generate reports. The user can add users, create new kit definitions, validate source files, prepare kits to be sent to the translation vendors, validate translated files received from a translation vendor, and locate the validated received files into the source code.


To run Resource Manager Command Line commands, enter:

java -jar <path-to-jarfile>/lrm-cli.jar command [<command option> [<option value>]]

For instance, if your client installation is located under C:\Lingoport\ResourceManagerClient-1.0, you could invoke commands this way:

 java -jar C:\Lingoport\ResourceManagerClient-1.0\lrm-cli.jar -help

You could also set an environment variable, either in Unix or in Windows, to shorten the typing. For instance:

 set LRM_CMD=java -jar c:\Lingoport\ResourceManagerClient-1.0\lrm-cli.jar
 %LRM_CMD% -help

The following example are based on setting the LRM_CMD environment variable in Windows. In Unix, it would be similar and the environment variable would look like $LRM_CMD

Help

To see what commands are available at the command line, type:

 %LRM_CMD% -help

Report Location

The default report location is defined in the lrmUserConfig.xml (see below). However, each report can be generated in the different location using the -f flag. To get a translation status generated in c:\tmp for instance, use the -fC:\tmp parameter on the -eL10nstatus swith, as in:

 %LRM_CMD% -eL10nstatus <kit-project-name> -fC:\tmp

Debug and Verbose Flags

The following flags are more for advanced usage. Each command can take a "-v" for verbose and/or and "-d" for debugging purposes. For instance

 %LRM_CMD% -eL10nstatus <kit-project-name> -d -v 

will produce a more verbose and technical output.

Resource Manager Client Configuration

Two files are used to configure the Resource Manager client:

  • application.properties: it is set up during installation and should not be need to be modified. It indicates how to connect to the Resource Manager database and in what locale the log file should be written.
  • lrmUserConfig.xml: this file is specific to a usage model of the Resource Manager client and should be modified to conform to the system on which the Resource Manager client is installed. It contains the Resource Manager user name and password, which directory contains the source code, where to generate the reports, etc.

lrmUserConfig.xml

This file holds some basic settings used by this client resource manager installation. The following elements are:

  • user-name: the Resource Manager user name. Actions are associated with one user, as many users can interact with the system. (See Adding a User below)
  • user-password: the password for that user. (See Adding a User below)
  • error-log: the location of the log file.
  • base-src-dir: the location of top level directory under which all your sources are kept. It could be "/" or "C:" or something more precise, such as "/projects/src/" for instance.
  • base-report-path: the directory where all reports are generated.
  • prep-kit-path: the location where kits are created. These are the kits which will be sent to translation

Adding a User

Adding a user in the server database is one step. The other step is to update the lrmUserConfig.xml file so running LRM uses that file to connect with user known to the server database. To add a user to the database, type:

 %LRM_CMD% -eadduser Username, Password

Any other command using the -p and -u parameters will update the lrmUserConfig.xml and keep that information so you don't have to retype username and password for subsequent commands. The easiest way to do this is to run the -ekitnames command:

 %LRM_CMD% -ekitnames -uUsername -pPassword

Kit Root Configuration

Your software project may be divvied up into modules and sub-components. You may want to have files sent in for translation in one kit for the entire application, or organized into many kits, for instance one per module. In order to prepare a kit, you must first configure how the kits will be created. This is the step where we create a kit root. In the Samples directory, you will find examples of some configurations. Copy one such file from the Samples directory into the KitDefinitions directory and adjust the parameters in that file:

  • kit-project-name: this name will be used when creating a kit or reporting on issues or displaying results in the Dashboard.
  • kit-desc: this is a description of the kit configuration
  • top-level-dir: the lrmUserConfig.xml has an element related to this one, the base-src-dir, which indicates where on your system all the source files are located. base-src-dir+top-level-dir tells the ResourceManager where to look for resource files. If you keep all your source files under base-src-dir=C:\myWorkSpace and your top-level-dir is Acme\src, then files under C:\myWorkSpace\Acme\src will be examined by the Resource Manager.
  • target-locales: the list of locales for translation. For instance, if the resource files need to be translated into Japanese and French, the list of target locales would include jp_JA and fr_FR.
  • default-locale: resources, text, typically defaults to a locale if the resource is not found.
  • resource-extension: what type of resources will be checked for validating, creating, verifying kits.
    • The extension can be properties, resx, rjs, rxml, rc, or po.
    • The file-name-pattern reflects how the locale is added to the file name. l is for language, c for country, and v is for variant. For instance, the file name pattern *_l_c indicates you expect a file sent as resources.properties to be translated in French to resources_fr_FR.properties.
    • The user-pattern-on-dflt-locale set to "1" indicates you will use source files such as resources_en_US.properties to be sent for transation. If set to "0", you expect files such as resources.properties to be sent for translation.
    • the file-location-pattern is used when directories (not file names) are suffixed based on a pattern.
  • dirset: is an Ant like directive to include or exclude directories or files from the kit creation.

To configure the kit with an updated file, typically in KitDefinitions, type the following command:

 %LRM_CMD% -ecreateconfig <kitdefinition>.xml

At any point during the process, type for following to check the kit definition:

 %LRM_CMD% -etestconfig <kit-project-name> 

It will create one file per locale under the reports\kit-project-name directory.

To get a starting <kitdefinition>.xml file for an existing project in the server database, type:

 %LRM_CMD% -edownload <kit-project-name>

This may come in handy when you want to modify an existing configuration. The resulting xml file is named SetupKitRootConfig.xml and is located under reports\<kit-project-name>

To update a configuration, download and modify the corresponding xml file and type:

  %LRM_CMD% -eupdateconfig <kitdefinition>.xml

To see what kits are configured in the Resource Manager at large, type:

 %LRM_CMD% -ekitnames


Once a kit root is configured, kits can be handled by the Resource Manager commands. Most of the daily work with resource files can start now.

Commands to send Kits for Translation

The major steps in this section deal with enumerating and checking files to be sent for translation and creating a kit based on valid files.

Check Source Files

Before creating a kit, you may want to first check for issues in the configuration or in the resource files to be sent for translation in the next kit. To do so, use the following command:

 %LRM_CMD% -eresourceissues <kit-project-name>

Make sure to check the result, located in the ResourceIssue.xml file under reports\<kit-project-name>

You may want to correct the issues before creating a kit to be sent for translation.

Check What Files Will Be Included In The Next Kit

Before creating a kit, you may want to enumerate exactly what files will be sent for translation. To do so, use the following command:

 %LRM_CMD% -eprepreport <kit-project-name>

Make sure to check the results, located in the BaseFileSearch<locale|error>.xml file under reports\<kit-project-name>. The BaseFileSearchErrors_en_US.xml is of particular interest. You probably want to make sure there are no errors before sending a kit.

Prepare a Kit

Each time you want to get a kit for the Acme project, you can run the kit preparation commands:

 %LRM_CMD% -eprep <kit-project-name>

The result of that command is put in prep_kit\<kit-project-name>\PREP_KIT_<x> under the Resource Manager client install directory. The first kit created will be under PREP_KIT_1, the second under PREP_KIT_2, etc. The PREP_KIT_<x> directory contains:

  • an XML file for each locale describing the base files for that kit
  • a directory for each locale with the files copied from source.

Important Note: if there are still errors in the files to be sent for translation, the PREP_KIT_<x> file will contain a BaseFileSearchErrors_<default-locale>.xml and the kit will not be created.

Commands to Receive Kits from Translation

The major steps in this section deal with enumerating and checking files returning from translation. For illustration purposes, let's name the directory where all the French translations are located FromL10nFrenchFrance.


The files under that directory are expected to be named <resourcesname><file-name-pattern>.<suffix>. For instance, if the configuration for properties files has a file-name-pattern of *_l_c, then a file sent as resources.properties</b> is expected to be translated to <code>resources_fr_FR.properties in FromL10nFrenchFrance.

Check Kits from Translation

If you do not want to copy the files to their location directly and you do want to check the incoming files for possible errors, you can type the following commands:

 %LRM_CMD% -eL10nissues -f<path-to>\FromL10nFrenchFrance

A directory under FromL10nFrenchFrance will be created with the name <kit-project-name><kitVersion><locale>; for instance AcmeProject_5_fr_FR. In that directory is the TranslationIssues.xml file which indicates the problems found with this translation. Verify and correct the problems if you can. You may also communicate with the translation vendor to get things corrected.

Copy Translated Files into Source Directory

To handle the returned files, type the following command:

 %LRM_CMD% -eL10nKit -f<path-to>\FromL10nFrenchFrance

If there are any errors, the same TranslationIssues.xml file as with the checking step will be created and no other action will be taken.

When there are no more errors detected by the Resource Manager, this command will distribute the files in their corresponding locations on the original source code. For instance, if the resources.properties file comes from the directory module1, the resources_fr_FR.properties will be copied to module1, based on the kit root configuration.

Getting an Overall Status

To get an overall status for a Resource Manager project, type this command:

 %LRM_CMD% -eL10nstatus <kit-project-name> 

The resulting file, TranslationStatus.xml, will be generated by default under the reports\<kit-project-name> directory.