Difference between revisions of "LRM Commands Reference"
(→Delete project) |
(→Reset a project) |
||
(117 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
== Introduction == |
== Introduction == |
||
− | To invoke a command, you must type <code>java -jar <path-to-jarfile> |
+ | To invoke a command, you must type <code>java -jar <path-to-jarfile>command.jar -parameters</code> |
− | For instance, on Linux, if the Lingoport Resource Manager Command Line Interface jar file is located under <code> |
+ | For instance, on Linux, if the Lingoport Resource Manager Command Line Interface jar file is located under <code><HOME>/lingoport/lrm-server-x.x</code> (the default location) and you want to see the help: |
− | <code>java -jar |
+ | <code>java -jar <HOME>/lingoport/lrm-server-x.x/lrm-cli.jar --help</code> |
Each command also has an abbreviation. The long version of each command starts with two dashes, <code>--</code>. The short version of each command starts with one dash, <code>-</code>. |
Each command also has an abbreviation. The long version of each command starts with two dashes, <code>--</code>. The short version of each command starts with one dash, <code>-</code>. |
||
For example, the previous example could have been written: |
For example, the previous example could have been written: |
||
− | <code>java -jar |
+ | <code>java -jar <HOME>/lingoport/lrm-server-x.x/lrm-cli.jar <b>-h</b></code> |
− | == To Note == |
||
The <b>help</b> provides a list of all available commands. The <code>debug</code> and the <code>verbose</code> flags can be applied to all commands. |
The <b>help</b> provides a list of all available commands. The <code>debug</code> and the <code>verbose</code> flags can be applied to all commands. |
||
<pre> |
<pre> |
||
Line 23: | Line 22: | ||
This reference gives the short and the long version of each Resource Manager command and a usage example. |
This reference gives the short and the long version of each Resource Manager command and a usage example. |
||
<pre> |
<pre> |
||
+ | -ak,--activate-kit Activate a kit. |
||
+ | Example: lrm-cli.jar -ak --project-name MyProject --kit-version 2 -gn MyGroup |
||
+ | -cb,--create-baseline Create a baseline. |
||
+ | Example: lrm-cli.jar -cb -pn MyProject -gn MyGroup |
||
+ | -cg,--create-group Create a new group/company. LRM expiration date is required. IQA expiration date is |
||
+ | optional. |
||
+ | Example: lrm-cli.jar -cg -gn Acme -nl 100 -dt 2020-12-31 -lkey 1234567 -dtiqa 2020-10-20 |
||
+ | -cp,--create-project Create a project from an xml file. |
||
+ | Example: lrm-cli.jar -cp -f C:/MyLocation/ProjectDefinition.xml -gn MyGroup |
||
+ | -d,--debug Log4j Debug mode |
||
− | - |
+ | -deleteProject,--delete-project Delete a project. |
− | --project- |
+ | Example: lrm-cli.jar --delete-project -pn MyProject -gn MyGroup |
− | - |
+ | -dk,--deactivate-kit Deactivate a specific kit. |
− | -- |
+ | Example: lrm-cli.jar -dk --project-name MyProject --kit-version 2 -gn MyGroup |
− | + | -dr,--dry-run Optional argument for --prep-kit. Runs --prep-kit without altering the database. |
|
− | -cp,--create-project Create a project from an xml file. |
||
− | Example: lrm-cli.jar -cp -f |
||
− | C:/MyLocation/Setup.xml |
||
− | -d,--debug Log4j Debug mode |
||
+ | -dt,--date <yyyy-MM-dd> Specifies a date. Expected format is `yyyy-MM-dd` |
||
− | -dk,--deactivate-kit Deactivate a specific kit. Example: |
||
− | lrm-cli.jar -dk --project-name MyProject |
||
− | --kit-version 2 |
||
− | -dp,--delete-project Delete a project. Example: lrm-cli.jar -dp |
||
− | --project-name MyProject |
||
− | -dr,--dry-run Optional argument for --prep-kit. Runs |
||
− | --prep-kit without altering the database. |
||
− | -ep,--export-project Export the project into an xml file. If |
||
− | option `-f` is not specified then the xml |
||
− | file is saved to the default report |
||
− | directory. Example: lrm-cli.jar -ep |
||
− | -f <string> Location of file (-f C:/MyLocation) or |
||
− | file name with path (-f |
||
− | C:/myfolder/myfile.xml) |
||
− | -h,--help Displays Help. |
||
+ | -dtiqa,--date-incontextqa <yyyy-MM-dd> Specifies the IQA Expiration Date. Expected format is `yyyy-MM-dd` |
||
− | -ii,--import-issues Report on all the active import issues. |
||
− | Example lrm-cli.jar -r -ii -pn |
||
− | MyProjectName |
||
− | -ik,--import-kit Import the translated kit. Example: |
||
− | lrm-cli.jar -ik -pn MyProject -f |
||
− | C:/KitLocation |
||
− | -ks,--kit-status Report on all the incomplete and complete |
||
− | kits. Example lrm-cli.jar -r -ks -pn |
||
− | MyProjectName |
||
− | -ksi,--kit-status-incomplete Report on all the incomplete kits. Example |
||
− | lrm-cli.jar -r -ksi -pn MyProjectName |
||
− | -kv,--kit-version <number> Specifies the kit version id when |
||
− | activating or deactivating a kit. |
||
− | -lp,--list-projects Lists all the projects to the console. |
||
− | Example: lrm-cli.jar -lp |
||
− | -nn,--new-name <string> Specifies either the new project name when |
||
− | renaming a project (-rp) or the user name |
||
− | when adding a user (-au). |
||
− | -np,--new-password <string> Specifies the password when adding a user |
||
− | (-au). |
||
− | -p,--password <string> Optional argument used to log into the LRM |
||
− | system as a different user than indicated |
||
− | in the LrmUserConfig.xml file. |
||
− | -pi,--project-inspect Report on all the files that were found |
||
− | using the project definition for the |
||
− | supplied project name. Example: |
||
− | lrm-cli.jar -r -pi -pn MyProjectName |
||
− | -pk,--prep-kit Prep a kit. Example: lrm-cli.jar -pk |
||
− | --project-name MyProject |
||
− | -pn,--project-name <string> Specifies the project name. |
||
+ | -ep,--export-project Export the project into an xml file. If option `-f` is not specified then the xml file |
||
− | -ps,--project-status Report on the productivity and status of |
||
− | the |
+ | is saved to the default report directory. |
− | lrm-cli.jar - |
+ | Example: lrm-cli.jar -ep --project-name MyProject -gn MyGroup |
+ | -f <path> Location of file (-f C:/MyLocation) or file name with path (-f C:/myfolder/myfile.xml) |
||
− | -r,--report Run a report that is specified by an |
||
− | additional option. If option `-f` is not |
||
− | specified then the report is saved to the |
||
− | default report directory. Example: |
||
− | lrm-cli.jar -r <report option> |
||
− | -rp,--rename-project Rename a project. Example: lrm-cli.jar -rp |
||
− | --project-name projectName --new-name |
||
− | NewName |
||
− | -si,--source-issues Report on the source issues for the |
||
− | supplied project name. Example: |
||
− | lrm-cli.jar -r -si -pn MyProjectName |
||
− | -u,--user <string> Optional argument used to log into the LRM |
||
− | system as a different user than indicated |
||
− | in the LrmUserConfig.xml file. |
||
− | -up,--update-project Update a project from an xml file. |
||
− | Example: lrm-cli.jar -up -f |
||
− | C:/MyLocation/Setup.xml |
||
− | -v,--verbose Verbose (console logging) |
||
+ | -fp,--files-to-prep Report on the number of files that will be prepped for each supported locale. |
||
+ | Example: lrm-cli.jar -r -fp -pn MyProjectName -gn MyGroup |
||
+ | -gn,--group-name <group> Specifies the group name. |
||
+ | -h,--help Displays Help. |
||
− | </pre> |
||
+ | -ii,--import-issues Report on all the active import issues. |
||
+ | Example lrm-cli.jar -r -ii -pn MyProjectName -gn MyGroup |
||
+ | -iit,--insert-ignoretags Insert ignore tags for all missed translations in the specified kit. |
||
+ | Example: lrm-cli.jar -iit -pn MyProject -kv 2 -f C:/LocationOfImportFiles -gn MyGroup |
||
+ | -ik,--import-kit Import the translated kit. |
||
+ | Example: lrm-cli.jar -ik -pn MyProject -kv 2 -lc fr_fr -f C:/LocationOfImportFiles -gn |
||
+ | MyGroup |
||
+ | -irf,--instrument-resource-files Instrument Resource Files. |
||
+ | Example: lrm-cli.jar -irf -pn MyProject -gn MyGroup |
||
+ | -ks,--kit-status Report on all the incomplete and complete kits. |
||
+ | Example lrm-cli.jar -r -ks -pn MyProjectName -gn MyGroup |
||
+ | -ksi,--kit-status-incomplete Report on all the incomplete kits. |
||
+ | Example lrm-cli.jar -r -ksi -pn MyProjectName -gn MyGroup |
||
+ | -kv,--kit-version <version#> Specifies the kit version id when importing a kit or when activating/deactivating a kit. |
||
+ | -l10np,--l10n-path Display the L10n base path. L10nStreamlining folder is appended to this base path. |
||
− | == Commands to Know == |
||
+ | Example: lrm-cli.jar -l10np. |
||
+ | -lc,--locale <locale(s)> Specifies a valid java locale for the set-due-date command or a list of locales for the |
||
+ | prep kit --override option. |
||
+ | -lg,--list-groups Lists all the groups to the console. |
||
+ | Example: lrm-cli.jar -lg |
||
+ | -lkey,--license-key <key#> Specifies the license key of a group/company license. |
||
+ | -lp,--list-projects Lists all the projects to the console. |
||
− | There are a few commands which are useful for getting started and debugging issues. |
||
+ | Example: lrm-cli.jar -lp -gn MyGroup |
||
+ | -lrmp,--lrm-path Display the LRM Data base path. Lingoport_Data/LRM folder is appended to this base path. |
||
+ | Example: lrm-cli.jar -lrmp. |
||
+ | -nl,--number-of-licenses <#> Specifies the number of licenses for a particular group/company |
||
+ | -or,--override Create a prep kit regardless of whether there are changes to the base files. |
||
− | To make things easier, set up an alias for the command. The examples below will be using the lrm alias |
||
+ | -pe,--project-exists Returns an exit code of 1 if the project does not exist otherwise 0. |
||
− | On Unix: |
||
+ | Example: lrm-cli.jar -pe --project-name MyProject -gn MyGroup |
||
+ | -pi,--project-inspect Report on all the files that were found using the project definition for the supplied |
||
+ | project name. |
||
+ | Example: lrm-cli.jar -r -pi -pn MyProjectName -gn MyGroup |
||
+ | -pk,--prep-kit Prep a kit. |
||
+ | Example: lrm-cli.jar -pk --project-name MyProject -gn MyGroup |
||
+ | -pl,--pseudo-loc Pseudo Localize project files. |
||
+ | Example: lrm-cli.jar -pl --project-name MyProject --group-name MyGroup |
||
+ | -pn,--project-name <project> Specifies the project name. |
||
+ | -ps,--project-status Report on the productivity and status of the supplied project name. |
||
− | <code> |
||
+ | Example lrm-cli.jar -r -ps -pn MyProjectName -gn MyGroup |
||
− | alias lrm='java -jar ~/lingoport/lrm-server-2.0/lrm-cli.jar' |
||
+ | -r,--report Run a report that is specified by an additional option. If option `-f` is not specified |
||
+ | then the report is saved to the default report directory. Example: lrm-cli.jar -r |
||
+ | <report option> |
||
+ | -resetProject,--reset-project Reset a project. This will delete and then recreate the project, maintaining the last |
||
+ | prep kit version. Example: lrm-cli.jar --reset-project -pn MyProject -gn MyGroup |
||
+ | -rf,--resource-file <resource-file(s)> List of resource files for the prep kit --override option. |
||
+ | -rgk,--remove-ghost-keys Remove ghost keys from translated files. |
||
− | lrm --version |
||
+ | Example: lrm-cli.jar -gn MyGroup -pn MyProject -rgk |
||
− | </code> |
||
+ | -rik,--reimport-kit Reimport the translated kit. |
||
+ | Example: lrm-cli.jar -rik -pn MyProject -kv 2 -lc fr_fr -f C:/LocationOfImportFiles -gn |
||
+ | MyGroup |
||
+ | -rs,--reviewer-status Report on the status of the requests for all Lqa Reviewers. |
||
+ | Example lrm-cli.jar -r -rs -f filePath |
||
+ | -sdd,--set-due-date Set the due date for the specified locale and prep kit version number. Due date will be |
||
+ | calculated if date option is not supplied. If option is supplied but there is no date |
||
+ | then due date is set to null. |
||
+ | Example: lrm-cli.jar -sdd -pn MyProjectName -kv 2 -dt "2014-01-27 14:23:30" -lc es_MX |
||
+ | -gn MyGroup |
||
+ | -si,--source-issues Report on the source issues for the supplied project name. |
||
+ | Example: lrm-cli.jar -r -si -pn MyProjectName -gn MyGroup |
||
+ | -tb,--track-back Create `Track Back` files for a project. |
||
+ | Example: lrm-cli.jar -tb --project-name MyProject --group-name MyGroup |
||
+ | -ul,--update-license Update a group/company license. LRM expiration date is required. IQA expiration date is |
||
+ | optional. |
||
+ | Example: lrm-cli.jar -ul -gn Acme -nl 100 -dt 2020-12-31 -lkey 145684938 -dtiqa |
||
+ | 2020-02-27 |
||
+ | -up,--update-project Update a project from an xml file. |
||
+ | Example: lrm-cli.jar -up -f C:/MyLocation/ProjectDefinition.xml -gn MyGroup |
||
+ | -v,--verbose Verbose (console logging) |
||
+ | -vn,--version LRM Version |
||
− | In Windows: |
||
+ | |||
+ | </pre> |
||
+ | == Commands to Know == |
||
− | <code> |
||
− | set "LRM=java -jar C:\Lingoport\LRM-Server-2.0\lrm-cli.jar" |
||
+ | <b>These commands are necessary to on-board a project and to handle licensing</b>. |
||
− | %LRM% --version |
||
− | </code> |
||
+ | To determine the various paths, use the '''--lrm-path''' and '''--l10n-path''' options which show the base paths for the LRM data and for L10nSteamlining |
||
− | === Create a project === |
||
− | <code> |
||
− | '''lrm --create-project -f <path to proj.xml file>''' |
||
− | </code> |
||
+ | java -jar ~/lingoport/lrm-server-x.y/lrm-cli.jar --lrm-path |
||
− | For example: |
||
+ | java -jar ~/lingoport/lrm-server-x.y/lrm-cli.jar --l10n-path |
||
− | <code> |
||
− | lrm -cp -f projects/MyProject.xml |
||
− | </code> |
||
− | The <code>-f</code> is the location of the project description file. The project description file must contain a '''<group-name>''' stanza and a '''<project-name>''' stanza otherwise the creation will fail. |
||
+ | To make things easier, set up an alias for the command. The examples below will be using the '''lrm''' alias |
||
− | <code> |
||
− | <project-name>MyProject</project-name> |
||
− | <group-name>Blue</group-name> |
||
− | <project-desc>This project contains resource files of all types for baseline testing</project-desc> |
||
− | <top-level-dir>Lingoport\test\MyProject\resources\</top-level-dir> |
||
− | <target-locales |
||
− | <locale>de_DE</locale> |
||
− | <locale>fr_FR</locale> |
||
− | <locale>zh_CN</locale> |
||
− | </target-locales> |
||
− | </code> |
||
+ | <pre> |
||
− | To see if there are multiple groups: |
||
+ | alias lrm='java -jar ~/lingoport/lrm-server-x.y/lrm-cli.jar' |
||
+ | lrm --version |
||
− | <code> |
||
+ | </pre> |
||
− | lrm --list-groups |
||
− | </code> |
||
− | To create a project when there are multiple groups use the <code>-gn</code> option. The group must match that in the MyProject.xml file. |
||
+ | === Group Commands === |
||
− | <code> |
||
+ | ==== Create a group ==== |
||
− | lrm -cp -f projects/MyProject.xml -gn <group-name> |
||
− | </code> |
||
− | |||
− | To verify that the project was created in a group. If there is only one group the <code>-gn</code> is optional: |
||
− | |||
− | <code> |
||
− | lrm -lp -gn <group-name> |
||
− | </code> |
||
− | |||
− | === Create a group === |
||
When creating a group, you must have the license associated with the group. Sometimes, the group is referred to as the company. These terms in Lingoport Resource Manager are interchangeable. If you do not have a license, contact support@lingoport.com. With the license you will have the following information: |
When creating a group, you must have the license associated with the group. Sometimes, the group is referred to as the company. These terms in Lingoport Resource Manager are interchangeable. If you do not have a license, contact support@lingoport.com. With the license you will have the following information: |
||
Line 180: | Line 162: | ||
* The license key (-lkey) - a 10-digit code provided by Lingoport |
* The license key (-lkey) - a 10-digit code provided by Lingoport |
||
+ | '''lrm --create-group --group-name <group-name> --number-of-licenses <number of licenses> --date <expiration-date> -license-key <license key>''' |
||
− | <code> |
||
− | '''lrm --create-group --group-name <group-name> --number-of-licenses <number of licenses> --date <expiration-date> -license-key <license key>''' |
||
− | </code> |
||
For example: |
For example: |
||
+ | lrm --create-group -gn Blue -nl 10 -dt 2016-12-31 -lkey 1234567890 |
||
− | <code> |
||
− | lrm --create-group -gn Blue -nl 10 -dt 2016-12-31 -lkey 1234567890 |
||
− | </code> |
||
To verify that the group was created successfully, use the '''--list-groups''' option. This will show the options used to create the group. |
To verify that the group was created successfully, use the '''--list-groups''' option. This will show the options used to create the group. |
||
+ | <pre> |
||
− | |||
− | <code> |
||
lrm -lg |
lrm -lg |
||
Line 198: | Line 175: | ||
Blue 10 2016-12-31 452 |
Blue 10 2016-12-31 452 |
||
Process completed successfully. |
Process completed successfully. |
||
− | </ |
+ | </pre> |
+ | |||
+ | ==== List Groups ==== |
||
+ | To see the groups that are currently in the Localyzer database, run the --list-groups command. |
||
+ | |||
+ | lrm --list-groups |
||
+ | |||
+ | To create a project when there are multiple groups use the '''<code>-gn</code>''' option. The group name must match that in the MyProject.xml file. |
||
+ | |||
+ | lrm -cp -f projects/MyProject.xml '''-gn <group-name>''' |
||
+ | |||
+ | To verify that the project was created in a group. If there is only one group the '''<code>-gn</code>''' is optional. |
||
+ | |||
+ | lrm -lp -gn <group-name> |
||
− | === Update a license === |
+ | ==== Update a license ==== |
If the expiration date for a license passes or there are more projects than the licensed number, a new license can be generated. Contact support@lingoport.com to get a new license. Just like when creating a new group, the following information is needed. The license key will be different than the one previously issued by Lingoport. |
If the expiration date for a license passes or there are more projects than the licensed number, a new license can be generated. Contact support@lingoport.com to get a new license. Just like when creating a new group, the following information is needed. The license key will be different than the one previously issued by Lingoport. |
||
Line 207: | Line 197: | ||
* The expiration date (-dt) |
* The expiration date (-dt) |
||
* The license key (-lkey) - a 10-digit code provided by Lingoport |
* The license key (-lkey) - a 10-digit code provided by Lingoport |
||
+ | |||
− | |||
+ | '''lrm --update-license --group-name <group-name> --number-of-licenses <number of licenses> -date <expiration date> --license-key <license key>''' |
||
− | <code> |
||
− | '''lrm --update-license --group-name <group-name> --number-of-licenses <number of licenses> -date <expiration date> --license-key <license key>''' |
||
− | </code> |
||
For example: |
For example: |
||
+ | lrm -ul -gn Blue -nl 100 -dt 2016-12-31 -lkey 9987654321 |
||
− | <code> |
||
− | lrm -ul -gn Blue -nl 100 -dt 2016-12-31 -lkey 9987654321 |
||
− | </code> |
||
To verify the change, use the --list-groups command |
To verify the change, use the --list-groups command |
||
− | < |
+ | <pre> |
lrm -lg |
lrm -lg |
||
Line 225: | Line 211: | ||
Blue 100 2016-12-31 452 |
Blue 100 2016-12-31 452 |
||
Process completed successfully. |
Process completed successfully. |
||
− | </ |
+ | </pre> |
− | === |
+ | === Project Commands === |
+ | ==== Create a project ==== |
||
+ | |||
+ | '''lrm --create-project -f <path to proj.xml file>''' |
||
+ | For example: |
||
− | After creating a project, there may be times when you want to change some of the LRM options and resources. To update the options: |
||
+ | |||
− | # Export the project to create the ProjectDefinition.xml file |
||
+ | lrm -cp -f projects/MyProject.xml |
||
+ | |||
+ | The '''<code>-f</code>''' is the location of the project definition file. See [[Supported_Resource_Bundles#Lingoport_Resource_Manager_Configuration| Project Definition]] for information on the contents of this file. |
||
+ | |||
+ | ==== Delete project ==== |
||
+ | |||
+ | A project can be deleted only on the command line. This command deletes all the project information from the database and '''cannot be undone'''. |
||
+ | |||
+ | '''lrm --deletePproject --project-name <Project> --group-name <group-name>''' |
||
+ | |||
+ | This will result as a prompt to verify that deleting the project is expected. This command cannot be used in a script. |
||
+ | |||
+ | For example: |
||
+ | |||
+ | lrm -deleteProject -pn MyProject -gn Blue |
||
+ | |||
+ | ==== Export a project ==== |
||
+ | Exporting a project will create a file '''ProjectDefinition.xml''' in the reports area. The default location for the reports directory is <code> '''<HOME>/Lingoport_Data/LRM/<group-name>/reports/<project>'''</code>. The -f option can be used to create the ProjectDefinition.xml file in a different location. |
||
+ | |||
+ | '''lrm --export-project --project-name <project> --group-name <group-name>''' |
||
+ | |||
+ | For example: |
||
+ | |||
+ | lrm -ep -pn MyProject -gn Blue |
||
+ | or |
||
+ | lrm -ep -pn MyProject -f /var/tmp -gn Blue |
||
+ | |||
+ | |||
+ | ==== Reset a project ==== |
||
+ | Sometimes, your project can get out-of-sync with your repo. One of the reasons that this can occur is if your repo structure is changed while there are outstanding prep kits. If it's not possible to deactivate the prep kit then the only choice may be to reset the project. This will delete the project in the database and recreate it without compromising the next prep kit version. If, for example, your next prep kit version is 111, then after resetting the project the next prep kit version will be 111. When you reset the project, any previous changes in text (as opposed to new keys) '''will''' not be detected as there is no longer a 'before' snapshot of the file before any changes occurred. |
||
+ | |||
+ | '''lrm --reset-project --project-name <project> --group-name <group-name>''' |
||
+ | |||
+ | |||
+ | This will result as a prompt to verify that resetting the project is expected. This command cannot be used in a script. |
||
+ | |||
+ | ==== Remove ghost keys ==== |
||
+ | This command will remove all the ''ghost keys'' from all the localized files. A ''ghost key'' is a key that exists only in the localized file but not in the base resource file. The removal of ghost keys automatically occurs during the import process but there may be legacy files that will never be prepped and imported. This is where the ''remove ghost keys'' command comes in handy. |
||
+ | |||
+ | '''lrm --remove-ghost-keys --project-name <project> --group-name <group-name>''' |
||
+ | |||
+ | ==== Update a project ==== |
||
+ | |||
+ | After creating a project, there may be times when you want to change some of the Localyzer options and resources. To update the options: |
||
+ | # Export the project to create a ProjectDefinition.xml file |
||
# Modify the ProjectDefinition.xml file |
# Modify the ProjectDefinition.xml file |
||
− | # Inspect the project to verify the changes. |
||
# Update the project to use the new changes. |
# Update the project to use the new changes. |
||
+ | First, export the project. |
||
− | First, export the project. This will create a file '''ProjectDefinition.xml''' in the reports area. The default location for the reports directory is <code> '''~/Lingoport_Data/LRM/<group-name>/reports/<project>'''</code>. The -f option can be used to create the ProjectDefinition.xml file in a different location. The --group-name is optional if there is only one group defined. |
||
+ | |||
+ | Next, modify the '''ProjectDefinition.xml''' file. The file can be modified to detect or skip various errors, which target locales to create and define the resources and their extensions. The file can also be modified to exclude various files in the search. |
||
+ | Update the project using the '''--update-project''' option. |
||
− | <code> |
||
+ | |||
− | lrm --export-project --project-name <project> --group-name <group-name> |
||
+ | lrm --update-project -f <location of ProjectDefinition.xml> |
||
− | </code> |
||
For example: |
For example: |
||
− | <code> |
||
− | lrm -ep -pn MyProject -gn Blue |
||
− | or |
||
− | lrm -ep -pn MyProject -f /var/tmp -gn Blue |
||
− | |||
− | </code> |
||
+ | lrm -up -f <HOME>/Lingoport_Data/LRM/<group-name>/reports/<project>/ProjectDefinition.xml -gn MyGroup |
||
− | Next, modify the ProjectDefinition.xml file. The file can be modified to detect or skip various errors, which target locales to create and define the resources and their extensions. The file can also be modified to exclude various files in the search. |
||
+ | or |
||
+ | lrm -up -pn MyProject -f /var/tmp/ProjectDefinition.xml -gn MyGroup |
||
+ | This will automatically generate Project Inspect reports and their location is shown in the command output. Review those files and verify that the information they contain is appropriate. |
||
− | To verify the changes, run a Project Inspection report. This creates ProjectInspect_xx_YY.xml (where xx_YY are locale identifiers) files in the default location at <code> '''~/Lingoport_Data/LRM/<group-name>/reports/<project>'''</code>. The -f option can be used to create the ProjectInspect_xx_YY.xml files in a different location. The --group-name is optional if there is only one group defined. |
||
+ | ==== Create a project baseline ==== |
||
− | <code> |
||
+ | During the baseline process, a snapshot is taken of all the base resource files so that modified text can be detected. This command is run during the Jenkins Notification jobs but can also be called from the command line. |
||
− | lrm --report --project-inspect --project-name <project> --group-name <group-name> |
||
+ | |||
− | </code> |
||
+ | Example: |
||
+ | lrm -cb -pn MyProject -gn MyGroup |
||
+ | |||
+ | Baselines will also be created prior to sending each prep kit. |
||
+ | |||
+ | === Transform Files === |
||
+ | ==== Create Pseudo-localized files ==== |
||
+ | The pseudo-localize command (-pl, --pseudo-loc) will pseudo-localize all base resource files. |
||
+ | Information about pseudo-localization can be found at [[Pseudo_Localization|Pseudo-Localization]] |
||
+ | |||
+ | The Localyzer command for pseudo-localizing files is: |
||
+ | java -jar lrm-cli.jar -pl -pn <project> -gn <group> |
||
+ | |||
+ | This command can be called from the project's Jenkins Automation Job by adding the [[Quick_On-Boarding_Reference#Pseudo-Localize_Build_Step_.28Optional.29|Pseudo-Localize]] build step. |
||
+ | |||
+ | ==== Create Instrumented files ==== |
||
+ | If there is a valid InContext license for the group, then files can be ''instrumented''. Localyzer instrumentation is the process of inserting non-printable characters into each resource string. These non-printable characters are used to access information about the key/value/file using either [[About_InContext_QA|InContext QA]] or [[About_InContext_Translation|InContext Translation]]. |
||
+ | The instrumented files all have a suffix of ''LRM_LQA''. For example, the instrumented file that corresponds to the resource file ''file1-fr-fr.properties'' will have the name ''file1-fr-fr_LRMLQA.properties''. The instrumented files are located in the same location as their corresponding resource file. |
||
+ | |||
+ | The console command to create instrumented files is: |
||
+ | <span style="background:#eaecf0"> |
||
+ | java -jar lrm-cli.jar -irf -pn <project> -gn <group> |
||
+ | :: or |
||
+ | java -jar lrm-cli.jar --instrument-resource-files -pn <project> -gn <group> |
||
+ | </span> |
||
+ | |||
+ | Instrumented files are automatically created during the prep kit process if the project's L10n Vendor configuration file has a valid [[L10n_Vendors#InContext_Server_Configuration.| InContext Server defined.]] |
||
+ | If using [[About_InContext_QA|InContext QA]] then instrumentation can occur during the Jenkins Automation job by adding the [[Quick_On-Boarding_Reference#IQA_Instrument_Build_Step_.28Optional.29|IQA Instrument Build Step]]. |
||
+ | |||
+ | === Create reports === |
||
+ | |||
+ | A number of Localyzer commands will create reports which can assist with creating prep kits and determining problems. Reports are run using the '''-r''' option followed by the report to be created in the default location at <code> '''~/Lingoport_Data/LRM/<group-name>/reports/<project>'''</code>. The '''-f''' option can be used to create the report files in different locations. The '''--group-name''' is optional if there is only one group defined. Many of the reports created are the same reports used to populate the Lingoport Dashboard. |
||
+ | |||
+ | '''lrm --report <report option> --project-name <Project> -group-name <group-name>''' |
||
+ | |||
+ | '''Files to Prep''' |
||
+ | |||
+ | Creates the '''FilesToPrep.xml''' file. |
||
+ | lrm --report --files-to-prep --project-name <Project> --group-name <group-name> |
||
For example: |
For example: |
||
+ | lrm -r -fp -pn MyProject -gn Blue |
||
− | <code> |
||
+ | |||
− | lrm -r -pi -pn MyProject -gn Blue |
||
+ | '''Import Issues''' |
||
− | or |
||
+ | |||
− | lrm -r -pi -pn MyProject -f /var/tmp -gn Blue |
||
+ | Creates the '''TranslationIssues.xml''' file for the active import issues. |
||
+ | lrm --report --import-issues --project-name <Project> --group-name <group-name> |
||
− | </code> |
||
+ | For example: |
||
+ | lrm -r -ii -pn MyProject -gn Blue |
||
+ | '''Kit Status''' |
||
− | Finally, update the project using the '''--update-project''' option. |
||
+ | Creates the '''PrepKitStatus.xml''' file. |
||
− | <code> |
||
+ | lrm --report --kit-status --project-name <Project> --group-name <group-name> |
||
− | lrm --update-project -f <location of ProjectDefinition.xml> |
||
− | </code> |
||
For example: |
For example: |
||
+ | lrm -r -ks -pn MyProject -gn Blue |
||
− | <code> |
||
− | lrm -up -f Lingoport_Data/LRM/<group-name>/reports/<project>/ProjectDefinition.xml |
||
− | or |
||
− | lrm -ep -pn MyProject -f /var/tmp/ProjectDefinition.xml |
||
− | </code> |
||
+ | '''Incomplete Kit Status''' |
||
− | === Delete project === |
||
+ | Creates the '''IncompletePrepKit.xml''' file. |
||
− | A project can be deleted if no prep kits have been created. The -gn flag is optional if there is only one group defined. |
||
+ | lrm --report --kit-status-incomplete --project-name <Project> --group-name <group-name> |
||
+ | For example: |
||
− | <code> |
||
+ | lrm -r -ksi -pn MyProject -gn Blue |
||
− | '''lrm --delete-project --project-name <Project> -group-name <group-name>''' |
||
+ | |||
− | </code> |
||
+ | '''Inspect Project''' |
||
+ | |||
+ | Creates the '''ProjectInspect_<locale>.xml''' files. See [[LRM_Commands_Reference#Project_Inspection|Project Inspection]] for report details. |
||
+ | lrm --report --project-inspect --project-name <Project> --group-name <group-name> |
||
For example: |
For example: |
||
+ | lrm -r -pi -pn MyProject -gn Blue |
||
− | <code> |
||
− | lrm -dp -pn MyProject -gn Blue |
||
− | </code> |
||
+ | '''Project Status''' |
||
− | === Create reports === |
||
+ | |||
+ | Creates the '''TranslationStatus.xml''' file. |
||
+ | lrm --report --project-status --project-name <Project> --group-name <group-name> |
||
+ | |||
+ | For example: |
||
+ | lrm -r -ps -pn MyProject -gn Blue |
||
+ | |||
+ | '''Source Issues''' |
||
+ | |||
+ | Creates the '''ResourceIssues.xml''' file. |
||
+ | lrm --report --source-issues --project-name <Project> --group-name <group-name> |
||
+ | |||
+ | For example: |
||
+ | lrm -r -si -pn MyProject -gn Blue |
||
+ | |||
+ | == Working with Prep Kits == |
||
+ | |||
+ | With Lingoport Resource Manager, much of the prep kit work is done by processes run under the Jenkins framework. <b>This section is provided for troubleshooting purposes. For any questions, contact <code>support@lingoport.com</code></b> |
||
+ | |||
+ | === Project Inspection=== |
||
+ | |||
+ | The first step you'll want to take with your new Lingoport Resource Manager Project is to make sure that Localyzer is finding all the resource files in your source code tree. We use the '''--project-inspect''' command to do this; Localyzer will search for all resources files described by your project's definitions, and create reports for each target locale, named ProjectInspect<locale>.xml, in your Localyzer Project's reports folder. The base locale |
||
+ | |||
+ | '''Base locale''': The starting locale which will be translated into the target locales. |
||
+ | |||
+ | '''Target locale''': The resulting translations from the base locale. For example if the base locale is en_US (United States English) and a target locale is fr_FR (France french), the resource files will start in English and be translated into French. |
||
+ | |||
+ | Enter the following command to create the report in the default location ../Lingoport_Data/LRM/<group>/reports/<project>: |
||
+ | lrm --report --project-inspect -pn <project name> -gn <group name> |
||
+ | |||
+ | Enter the following command to create the report in a specific location: |
||
+ | lrm --report --project-inspect -pn <project name> -gn <group name> -f <location for reports> |
||
+ | |||
+ | For the base locale, the resulting '''ProjectInspect<baseLocale>.xml''' report contains: |
||
+ | |||
+ | * The associated LRM project name and source path |
||
+ | * The locale and whether it is the base locale |
||
+ | * The total number of resource files found |
||
+ | * A listing of each resource file |
||
+ | |||
+ | For each target locale, the resulting '''ProjectInspect<locale>.xml''' report contains: |
||
+ | * The associated LRM project name and source path |
||
+ | * The locale and whether it is the base locale |
||
+ | * The total number of resource files based on the number of base resource files |
||
+ | * A listing of each resource file. These files may not currently exist, but will be created once an Localyzer import is successful |
||
+ | |||
+ | The '''ProjectDefinition.xml''' report contains: |
||
+ | * The definition for the project. This report contains the information entered in the project's Jenkins Automation job. See [[On_Boarding_the_Automation_Job#Configuring_the_LRM_section_of_a_project| Configure LRM Project]] |
||
+ | |||
+ | Report '''project_inspect_files.txt''' is created in ../Lingoport_Data/L10nStreamlining/<group>/project/<projects>/reports |
||
+ | * Contains all the corresponding target files for each base resource file. The target file's absolute path is determined by the name and location patterns defined for the extension in the project definition file. The project definition is set up in the project's Jenkins Automation job. See [[On_Boarding_the_Automation_Job#Configuring_the_LRM_section_of_a_project| Configure LRM Project]] |
||
+ | |||
+ | |||
+ | |||
+ | Be sure to check the base locale reports for any errors, including omissions and incorrect duplicate resource files. If you find problems, make sure you have the latest version of your Localyzer Project's Definition.xml file (use project-export command) and then modify it, possibly adding exclude and include folders to tailor Localyzer search for resource files. Run the project-update command to store the latest project definitions and verify with project-inspect reports. The target locale reports will be a reflection of the base locale report, showing you the resource files that will be created for translation. |
||
+ | |||
+ | ===Exporting and Updating an LRM project=== |
||
+ | |||
+ | If you want to update an LRM Project's configuration, you should first run the '''--export-project''' command to export the latest configuration settings, make any changes, and then run the '''--update-project''' command. |
||
+ | |||
+ | For example: |
||
+ | lrm --export-project --project-name <MyProject> |
||
+ | |||
+ | LRM will create a file named ProjectDefinition.xml in your Localyzer Project's reports folder ('''<code><home>/Lingoport_Data/LRM/<group-name>/reports/MyProject</code>'''), unless you include the -f option to locate it elsewhere, with all the latest settings associated with your Localyzer Project. Once you modify this file, you can run the Localyzer --update-project command to update the Localyzer Project's stored configuration: |
||
+ | lrm --update-project -f <home>/Lingoport_Data/LRM/<group-name>/reports/MyProject |
||
+ | |||
+ | ===Fixing the Project Definition=== |
||
+ | |||
+ | If, after running the Project Inspect report, you notice that more files need to included or excluded then fix the project definition by running --update-project and then run the Project Inspect report to verify that the expected files are displayed in the report. Run the following commands until the correct files are included and excluded: |
||
+ | lrm --update-project -f <path to the ProjectDefinition.xml file> |
||
+ | lrm -r --project-inspect -pn <Project Name> |
||
+ | |||
+ | ===Preparing a Kit=== |
||
+ | |||
+ | A Kit is what we call the set of resource files that are gathered by Localyzer, set out for translation, and then integrated back into the source code tree once translated. Localyzer sets and tracks versions of a Kit so that, as your developers add strings to the base resource files, you can prepare and send out the Kit multiple times. There are a variety of checks that Localyzer makes on the base resource files to ensure that they are correct, as well as tracking the progress and correctness of the translated resource files. |
||
+ | Note: If your project contains translated files, then when prepping your first kit, Localyzer will not be able to detect if a text change has occurred within a resource string. It will, however, be able to detect added keys or missed translations. |
||
+ | |||
+ | ===Dry Run Kit Preparation=== |
||
+ | |||
+ | Once Localyzer Project's set of resource files has been validated using the --project-inspect command, create the first Kit to send out for translation, using the '''--prep-kit''' command. However, to make sure that the Kit has no errors, we recommend that first using the '''--dry-run''' option. This will go through the steps of Kit creation, including checking for errors, without actually creating the Kit and storing information in the Localyzer database. |
||
+ | |||
+ | lrm --prep-kit --dry-run --project-name <project name> |
||
+ | |||
+ | The resulting '''BaseFileSearch<target locale>.xml''' report files are located in the reports folder (<code><home>/Lingoport_Data/LRM/<group-name>/reports/MyProject</code>), unless you include the -f option to locate it elsewhere. Be sure to check all the target locale reports to make sure that the set of resource files is correct. Remember that although the first time you'll be sending out all base resource files for translation, subsequent Kit preparations will only include base resource files that have actually changed since the last time the --prep-kit command was run. In addition, if there are warnings or errors in the base resource files (the default locale), one of these report files will be created: '''BaseFileSearchErrors<default locale>.xml''' will contain both errors and warnings; '''BaseFileSearchWarnings<default locale>.xml''' will be created if there are only warnings detected. While warnings do not need to be fixed, you must correct all errors in order to create a Kit. |
||
+ | |||
+ | |||
+ | Base resource file errors and warnings detected are: |
||
+ | |||
+ | ENCODING - the base-file-encoding you set in your Localyzer Project's definitions xml file does not match. You should fix the encoding of the base resource file and run --prep-kit --dry-run again. |
||
+ | DUPLICATE_KEY - there is a duplicate string key in the base resource file. Remove the duplicate and run --prep-kit --dry-run again. |
||
+ | EMPTY_KEY - the value has no corresponding key. Either remove the value from the file or add the appropriate key. |
||
+ | EMPTY_VALUE - the string key in the base resource file is set to an empty string. This is just a warning and will not prevent you from creating and sending out a Kit |
||
+ | FILE_TOO_BIG - a base resource file cannot be larger than 16 megabytes. You will need to break up your resource file into multiple files and then run --prep-kit --dry-run again. |
||
+ | |||
+ | In addition to the '''BaseFileSearch<default locale>.xml''' report, if you have already run a --prep-kit command and sent files out for translation, then you may also see '''OutstandingPrepFiles<target locale>.xml''' reports in the folder. These files will contain all the resource files that have not been received back from translation and subsequently, imported into the source code. If a resource file is 'outstanding' but has changed since the last time it was sent out for translation then it will be included in the prep kit. |
||
+ | |||
+ | |||
+ | If there are duplicate file names, then the report '''DuplicatePrepFiles<target locale>.xml''' will be created listing the duplicate file names. This is an indication that another kit will need to be prepared after the current kit has successfully been prepped. |
||
+ | |||
+ | ===Kit Preparation=== |
||
+ | |||
+ | With the '''--dry-run''' option running successfully, you're ready to prepare a Kit for translation. You do this by running the '''--prep-kit''' command with only the Localyzer project name. |
||
+ | |||
+ | lrm --prep-kit --project-name <project name> |
||
+ | |||
+ | By default, the Kit is created under your 'prep_kit' folder,. Each time you prepare a Kit for your Localyzer project, Localyzer will create a folder named PREP_KIT_<version>,(<code><HOME>/Lingoport_Data/LRM/<group-name>/prep_kit/MyProject</code>), with all the latest settings associated with your Localyzer Project where <version> is the kit version number. For example, if you ran --prep-kit on your LRM Project named MyProject, the first Kit would be created in the folder (<code><HOME>/Lingoport_Data/LRM/<group-name>/prep_kit/MyProject/PREP_KIT_1</code>. |
||
+ | |||
+ | The PREP_KIT_<version> contains: |
||
+ | |||
+ | * A folder for each locale with a copy of each base resource file that has changed since the last time the kit was prepped. If the '''prep.kit.changes.only''' option is set in the '''config_lrm_info.properties''' file then the resource files will contain only the key/value pairs that have changed since the last time the kit was prepped; |
||
+ | * A '''BaseFileSearch<target locale>.xml''' file for each locale describing the base files for the kit; |
||
+ | * If Localyzer detected only warnings in your base resource files, then there will also be a '''BaseFileSearchWarnings<default locale>.xml''' file describing the warnings. |
||
+ | * However, if there are errors in the base resource files (rather than just warnings), the PREP_KIT_<version> folder will contain a '''BaseFileSearchErrors<default locale>.xml''' file and the kit will ''not be created''. You must correct all errors prior to preparing a kit. |
||
+ | |||
+ | The PREP_KIT_<version> folder is what you send out for translation. The localization vendor will translate the resource files in each of the target locale folders. |
||
+ | |||
+ | Important Note: It is required that the resource files in the target locale folders are translated and returned, maintaining all the other text in the resource files. This is because Localyzer places a comment tag at the top of each resource file that indicates the Localyzer Project, Kit version and target locale, which Localyzer needs during the Kit Import process. An example Localyzer tag is: MyProjectName_1_5 |
||
+ | |||
+ | ==== Override Prep Kit ==== |
||
+ | The override option of the prep kit command will prep a kit regardless of whether there are changes to the base resource files. The prep kit can be filtered by base resource files (--resource-file options) as well as locales (--locale option). If there are no additional options then all base resource file will be sent out for translation. |
||
+ | Examples: |
||
− | A number of LRM commands will create reports. |
||
+ | * Create a prep kit for all base resource files |
||
+ | java -jar lrm-cli.jar -pk --override -pn <project> -gn <group> |
||
+ | * Create a prep kit for specific locales |
||
+ | java -jar lrm-cli.jar -pk --override -pn <project> -gn <group> --locale fr,de,es_mx |
||
+ | * Create a prep kit for specific resource files |
||
+ | java -jar lrm-cli.jar -pk -or -pn <project> -gn <group> --resource-file /var/lib/jenkins/myproject/resources/file1.properties,/var/lib/jenkins/myproject/resources/file2.properties |
||
+ | * Create a prep kit for a specific locale file |
||
+ | java -jar lrm-cli.jar -pk -or -pn <project> -gn <group> -lc fr -rf /var/lib/jenkins/myproject/resources/file3.properties |
Latest revision as of 16:49, 29 April 2022
Contents
Introduction
To invoke a command, you must type java -jar <path-to-jarfile>command.jar -parameters
For instance, on Linux, if the Lingoport Resource Manager Command Line Interface jar file is located under <HOME>/lingoport/lrm-server-x.x
(the default location) and you want to see the help:
java -jar <HOME>/lingoport/lrm-server-x.x/lrm-cli.jar --help
Each command also has an abbreviation. The long version of each command starts with two dashes, --
. The short version of each command starts with one dash, -
.
For example, the previous example could have been written:
java -jar <HOME>/lingoport/lrm-server-x.x/lrm-cli.jar -h
The help provides a list of all available commands. The debug
and the verbose
flags can be applied to all commands.
-d,--debug Log4j Debug mode -v,--verbose Verbose (console logging) -h,--help Displays Help.
Reference
This reference gives the short and the long version of each Resource Manager command and a usage example.
-ak,--activate-kit Activate a kit. Example: lrm-cli.jar -ak --project-name MyProject --kit-version 2 -gn MyGroup -cb,--create-baseline Create a baseline. Example: lrm-cli.jar -cb -pn MyProject -gn MyGroup -cg,--create-group Create a new group/company. LRM expiration date is required. IQA expiration date is optional. Example: lrm-cli.jar -cg -gn Acme -nl 100 -dt 2020-12-31 -lkey 1234567 -dtiqa 2020-10-20 -cp,--create-project Create a project from an xml file. Example: lrm-cli.jar -cp -f C:/MyLocation/ProjectDefinition.xml -gn MyGroup -d,--debug Log4j Debug mode -deleteProject,--delete-project Delete a project. Example: lrm-cli.jar --delete-project -pn MyProject -gn MyGroup -dk,--deactivate-kit Deactivate a specific kit. Example: lrm-cli.jar -dk --project-name MyProject --kit-version 2 -gn MyGroup -dr,--dry-run Optional argument for --prep-kit. Runs --prep-kit without altering the database. -dt,--date <yyyy-MM-dd> Specifies a date. Expected format is `yyyy-MM-dd` -dtiqa,--date-incontextqa <yyyy-MM-dd> Specifies the IQA Expiration Date. Expected format is `yyyy-MM-dd` -ep,--export-project Export the project into an xml file. If option `-f` is not specified then the xml file is saved to the default report directory. Example: lrm-cli.jar -ep --project-name MyProject -gn MyGroup -f <path> Location of file (-f C:/MyLocation) or file name with path (-f C:/myfolder/myfile.xml) -fp,--files-to-prep Report on the number of files that will be prepped for each supported locale. Example: lrm-cli.jar -r -fp -pn MyProjectName -gn MyGroup -gn,--group-name <group> Specifies the group name. -h,--help Displays Help. -ii,--import-issues Report on all the active import issues. Example lrm-cli.jar -r -ii -pn MyProjectName -gn MyGroup -iit,--insert-ignoretags Insert ignore tags for all missed translations in the specified kit. Example: lrm-cli.jar -iit -pn MyProject -kv 2 -f C:/LocationOfImportFiles -gn MyGroup -ik,--import-kit Import the translated kit. Example: lrm-cli.jar -ik -pn MyProject -kv 2 -lc fr_fr -f C:/LocationOfImportFiles -gn MyGroup -irf,--instrument-resource-files Instrument Resource Files. Example: lrm-cli.jar -irf -pn MyProject -gn MyGroup -ks,--kit-status Report on all the incomplete and complete kits. Example lrm-cli.jar -r -ks -pn MyProjectName -gn MyGroup -ksi,--kit-status-incomplete Report on all the incomplete kits. Example lrm-cli.jar -r -ksi -pn MyProjectName -gn MyGroup -kv,--kit-version <version#> Specifies the kit version id when importing a kit or when activating/deactivating a kit. -l10np,--l10n-path Display the L10n base path. L10nStreamlining folder is appended to this base path. Example: lrm-cli.jar -l10np. -lc,--locale <locale(s)> Specifies a valid java locale for the set-due-date command or a list of locales for the prep kit --override option. -lg,--list-groups Lists all the groups to the console. Example: lrm-cli.jar -lg -lkey,--license-key <key#> Specifies the license key of a group/company license. -lp,--list-projects Lists all the projects to the console. Example: lrm-cli.jar -lp -gn MyGroup -lrmp,--lrm-path Display the LRM Data base path. Lingoport_Data/LRM folder is appended to this base path. Example: lrm-cli.jar -lrmp. -nl,--number-of-licenses <#> Specifies the number of licenses for a particular group/company -or,--override Create a prep kit regardless of whether there are changes to the base files. -pe,--project-exists Returns an exit code of 1 if the project does not exist otherwise 0. Example: lrm-cli.jar -pe --project-name MyProject -gn MyGroup -pi,--project-inspect Report on all the files that were found using the project definition for the supplied project name. Example: lrm-cli.jar -r -pi -pn MyProjectName -gn MyGroup -pk,--prep-kit Prep a kit. Example: lrm-cli.jar -pk --project-name MyProject -gn MyGroup -pl,--pseudo-loc Pseudo Localize project files. Example: lrm-cli.jar -pl --project-name MyProject --group-name MyGroup -pn,--project-name <project> Specifies the project name. -ps,--project-status Report on the productivity and status of the supplied project name. Example lrm-cli.jar -r -ps -pn MyProjectName -gn MyGroup -r,--report Run a report that is specified by an additional option. If option `-f` is not specified then the report is saved to the default report directory. Example: lrm-cli.jar -r <report option> -resetProject,--reset-project Reset a project. This will delete and then recreate the project, maintaining the last prep kit version. Example: lrm-cli.jar --reset-project -pn MyProject -gn MyGroup -rf,--resource-file <resource-file(s)> List of resource files for the prep kit --override option. -rgk,--remove-ghost-keys Remove ghost keys from translated files. Example: lrm-cli.jar -gn MyGroup -pn MyProject -rgk -rik,--reimport-kit Reimport the translated kit. Example: lrm-cli.jar -rik -pn MyProject -kv 2 -lc fr_fr -f C:/LocationOfImportFiles -gn MyGroup -rs,--reviewer-status Report on the status of the requests for all Lqa Reviewers. Example lrm-cli.jar -r -rs -f filePath -sdd,--set-due-date Set the due date for the specified locale and prep kit version number. Due date will be calculated if date option is not supplied. If option is supplied but there is no date then due date is set to null. Example: lrm-cli.jar -sdd -pn MyProjectName -kv 2 -dt "2014-01-27 14:23:30" -lc es_MX -gn MyGroup -si,--source-issues Report on the source issues for the supplied project name. Example: lrm-cli.jar -r -si -pn MyProjectName -gn MyGroup -tb,--track-back Create `Track Back` files for a project. Example: lrm-cli.jar -tb --project-name MyProject --group-name MyGroup -ul,--update-license Update a group/company license. LRM expiration date is required. IQA expiration date is optional. Example: lrm-cli.jar -ul -gn Acme -nl 100 -dt 2020-12-31 -lkey 145684938 -dtiqa 2020-02-27 -up,--update-project Update a project from an xml file. Example: lrm-cli.jar -up -f C:/MyLocation/ProjectDefinition.xml -gn MyGroup -v,--verbose Verbose (console logging) -vn,--version LRM Version
Commands to Know
These commands are necessary to on-board a project and to handle licensing.
To determine the various paths, use the --lrm-path and --l10n-path options which show the base paths for the LRM data and for L10nSteamlining
java -jar ~/lingoport/lrm-server-x.y/lrm-cli.jar --lrm-path
java -jar ~/lingoport/lrm-server-x.y/lrm-cli.jar --l10n-path
To make things easier, set up an alias for the command. The examples below will be using the lrm alias
alias lrm='java -jar ~/lingoport/lrm-server-x.y/lrm-cli.jar' lrm --version
Group Commands
Create a group
When creating a group, you must have the license associated with the group. Sometimes, the group is referred to as the company. These terms in Lingoport Resource Manager are interchangeable. If you do not have a license, contact support@lingoport.com. With the license you will have the following information:
- The group name (-gn)
- The number of licenses (-nl) - this determines how many projects you can create under this group.
- The expiration date (-dt)
- The license key (-lkey) - a 10-digit code provided by Lingoport
lrm --create-group --group-name <group-name> --number-of-licenses <number of licenses> --date <expiration-date> -license-key <license key>
For example:
lrm --create-group -gn Blue -nl 10 -dt 2016-12-31 -lkey 1234567890
To verify that the group was created successfully, use the --list-groups option. This will show the options used to create the group.
lrm -lg Name Max Project Exp Date Days Left Blue 10 2016-12-31 452 Process completed successfully.
List Groups
To see the groups that are currently in the Localyzer database, run the --list-groups command.
lrm --list-groups
To create a project when there are multiple groups use the -gn
option. The group name must match that in the MyProject.xml file.
lrm -cp -f projects/MyProject.xml -gn <group-name>
To verify that the project was created in a group. If there is only one group the -gn
is optional.
lrm -lp -gn <group-name>
Update a license
If the expiration date for a license passes or there are more projects than the licensed number, a new license can be generated. Contact support@lingoport.com to get a new license. Just like when creating a new group, the following information is needed. The license key will be different than the one previously issued by Lingoport.
- The group name (-gn)
- The number of licenses (-nl) - this determines how many projects you can create under this group.
- The expiration date (-dt)
- The license key (-lkey) - a 10-digit code provided by Lingoport
lrm --update-license --group-name <group-name> --number-of-licenses <number of licenses> -date <expiration date> --license-key <license key>
For example:
lrm -ul -gn Blue -nl 100 -dt 2016-12-31 -lkey 9987654321
To verify the change, use the --list-groups command
lrm -lg Name Max Project Exp Date Days Left Blue 100 2016-12-31 452 Process completed successfully.
Project Commands
Create a project
lrm --create-project -f <path to proj.xml file>
For example:
lrm -cp -f projects/MyProject.xml
The -f
is the location of the project definition file. See Project Definition for information on the contents of this file.
Delete project
A project can be deleted only on the command line. This command deletes all the project information from the database and cannot be undone.
lrm --deletePproject --project-name <Project> --group-name <group-name>
This will result as a prompt to verify that deleting the project is expected. This command cannot be used in a script.
For example:
lrm -deleteProject -pn MyProject -gn Blue
Export a project
Exporting a project will create a file ProjectDefinition.xml in the reports area. The default location for the reports directory is <HOME>/Lingoport_Data/LRM/<group-name>/reports/<project>
. The -f option can be used to create the ProjectDefinition.xml file in a different location.
lrm --export-project --project-name <project> --group-name <group-name>
For example:
lrm -ep -pn MyProject -gn Blue
or
lrm -ep -pn MyProject -f /var/tmp -gn Blue
Reset a project
Sometimes, your project can get out-of-sync with your repo. One of the reasons that this can occur is if your repo structure is changed while there are outstanding prep kits. If it's not possible to deactivate the prep kit then the only choice may be to reset the project. This will delete the project in the database and recreate it without compromising the next prep kit version. If, for example, your next prep kit version is 111, then after resetting the project the next prep kit version will be 111. When you reset the project, any previous changes in text (as opposed to new keys) will not be detected as there is no longer a 'before' snapshot of the file before any changes occurred.
lrm --reset-project --project-name <project> --group-name <group-name>
This will result as a prompt to verify that resetting the project is expected. This command cannot be used in a script.
Remove ghost keys
This command will remove all the ghost keys from all the localized files. A ghost key is a key that exists only in the localized file but not in the base resource file. The removal of ghost keys automatically occurs during the import process but there may be legacy files that will never be prepped and imported. This is where the remove ghost keys command comes in handy.
lrm --remove-ghost-keys --project-name <project> --group-name <group-name>
Update a project
After creating a project, there may be times when you want to change some of the Localyzer options and resources. To update the options:
- Export the project to create a ProjectDefinition.xml file
- Modify the ProjectDefinition.xml file
- Update the project to use the new changes.
First, export the project.
Next, modify the ProjectDefinition.xml file. The file can be modified to detect or skip various errors, which target locales to create and define the resources and their extensions. The file can also be modified to exclude various files in the search.
Update the project using the --update-project option.
lrm --update-project -f <location of ProjectDefinition.xml>
For example:
lrm -up -f <HOME>/Lingoport_Data/LRM/<group-name>/reports/<project>/ProjectDefinition.xml -gn MyGroup
or
lrm -up -pn MyProject -f /var/tmp/ProjectDefinition.xml -gn MyGroup
This will automatically generate Project Inspect reports and their location is shown in the command output. Review those files and verify that the information they contain is appropriate.
Create a project baseline
During the baseline process, a snapshot is taken of all the base resource files so that modified text can be detected. This command is run during the Jenkins Notification jobs but can also be called from the command line.
Example:
lrm -cb -pn MyProject -gn MyGroup
Baselines will also be created prior to sending each prep kit.
Transform Files
Create Pseudo-localized files
The pseudo-localize command (-pl, --pseudo-loc) will pseudo-localize all base resource files. Information about pseudo-localization can be found at Pseudo-Localization
The Localyzer command for pseudo-localizing files is:
java -jar lrm-cli.jar -pl -pn <project> -gn <group>
This command can be called from the project's Jenkins Automation Job by adding the Pseudo-Localize build step.
Create Instrumented files
If there is a valid InContext license for the group, then files can be instrumented. Localyzer instrumentation is the process of inserting non-printable characters into each resource string. These non-printable characters are used to access information about the key/value/file using either InContext QA or InContext Translation. The instrumented files all have a suffix of LRM_LQA. For example, the instrumented file that corresponds to the resource file file1-fr-fr.properties will have the name file1-fr-fr_LRMLQA.properties. The instrumented files are located in the same location as their corresponding resource file.
The console command to create instrumented files is:
java -jar lrm-cli.jar -irf -pn <project> -gn <group>
- or
java -jar lrm-cli.jar --instrument-resource-files -pn <project> -gn <group>
Instrumented files are automatically created during the prep kit process if the project's L10n Vendor configuration file has a valid InContext Server defined. If using InContext QA then instrumentation can occur during the Jenkins Automation job by adding the IQA Instrument Build Step.
Create reports
A number of Localyzer commands will create reports which can assist with creating prep kits and determining problems. Reports are run using the -r option followed by the report to be created in the default location at ~/Lingoport_Data/LRM/<group-name>/reports/<project>
. The -f option can be used to create the report files in different locations. The --group-name is optional if there is only one group defined. Many of the reports created are the same reports used to populate the Lingoport Dashboard.
lrm --report <report option> --project-name <Project> -group-name <group-name>
Files to Prep
Creates the FilesToPrep.xml file.
lrm --report --files-to-prep --project-name <Project> --group-name <group-name>
For example:
lrm -r -fp -pn MyProject -gn Blue
Import Issues
Creates the TranslationIssues.xml file for the active import issues.
lrm --report --import-issues --project-name <Project> --group-name <group-name>
For example:
lrm -r -ii -pn MyProject -gn Blue
Kit Status
Creates the PrepKitStatus.xml file.
lrm --report --kit-status --project-name <Project> --group-name <group-name>
For example:
lrm -r -ks -pn MyProject -gn Blue
Incomplete Kit Status
Creates the IncompletePrepKit.xml file.
lrm --report --kit-status-incomplete --project-name <Project> --group-name <group-name>
For example:
lrm -r -ksi -pn MyProject -gn Blue
Inspect Project
Creates the ProjectInspect_<locale>.xml files. See Project Inspection for report details.
lrm --report --project-inspect --project-name <Project> --group-name <group-name>
For example:
lrm -r -pi -pn MyProject -gn Blue
Project Status
Creates the TranslationStatus.xml file.
lrm --report --project-status --project-name <Project> --group-name <group-name>
For example:
lrm -r -ps -pn MyProject -gn Blue
Source Issues
Creates the ResourceIssues.xml file.
lrm --report --source-issues --project-name <Project> --group-name <group-name>
For example:
lrm -r -si -pn MyProject -gn Blue
Working with Prep Kits
With Lingoport Resource Manager, much of the prep kit work is done by processes run under the Jenkins framework. This section is provided for troubleshooting purposes. For any questions, contact support@lingoport.com
Project Inspection
The first step you'll want to take with your new Lingoport Resource Manager Project is to make sure that Localyzer is finding all the resource files in your source code tree. We use the --project-inspect command to do this; Localyzer will search for all resources files described by your project's definitions, and create reports for each target locale, named ProjectInspect<locale>.xml, in your Localyzer Project's reports folder. The base locale
Base locale: The starting locale which will be translated into the target locales.
Target locale: The resulting translations from the base locale. For example if the base locale is en_US (United States English) and a target locale is fr_FR (France french), the resource files will start in English and be translated into French.
Enter the following command to create the report in the default location ../Lingoport_Data/LRM/<group>/reports/<project>:
lrm --report --project-inspect -pn <project name> -gn <group name>
Enter the following command to create the report in a specific location:
lrm --report --project-inspect -pn <project name> -gn <group name> -f <location for reports>
For the base locale, the resulting ProjectInspect<baseLocale>.xml report contains:
- The associated LRM project name and source path
- The locale and whether it is the base locale
- The total number of resource files found
- A listing of each resource file
For each target locale, the resulting ProjectInspect<locale>.xml report contains:
- The associated LRM project name and source path
- The locale and whether it is the base locale
- The total number of resource files based on the number of base resource files
- A listing of each resource file. These files may not currently exist, but will be created once an Localyzer import is successful
The ProjectDefinition.xml report contains:
- The definition for the project. This report contains the information entered in the project's Jenkins Automation job. See Configure LRM Project
Report project_inspect_files.txt is created in ../Lingoport_Data/L10nStreamlining/<group>/project/<projects>/reports
- Contains all the corresponding target files for each base resource file. The target file's absolute path is determined by the name and location patterns defined for the extension in the project definition file. The project definition is set up in the project's Jenkins Automation job. See Configure LRM Project
Be sure to check the base locale reports for any errors, including omissions and incorrect duplicate resource files. If you find problems, make sure you have the latest version of your Localyzer Project's Definition.xml file (use project-export command) and then modify it, possibly adding exclude and include folders to tailor Localyzer search for resource files. Run the project-update command to store the latest project definitions and verify with project-inspect reports. The target locale reports will be a reflection of the base locale report, showing you the resource files that will be created for translation.
Exporting and Updating an LRM project
If you want to update an LRM Project's configuration, you should first run the --export-project command to export the latest configuration settings, make any changes, and then run the --update-project command.
For example:
lrm --export-project --project-name <MyProject>
LRM will create a file named ProjectDefinition.xml in your Localyzer Project's reports folder (<home>/Lingoport_Data/LRM/<group-name>/reports/MyProject
), unless you include the -f option to locate it elsewhere, with all the latest settings associated with your Localyzer Project. Once you modify this file, you can run the Localyzer --update-project command to update the Localyzer Project's stored configuration:
lrm --update-project -f <home>/Lingoport_Data/LRM/<group-name>/reports/MyProject
Fixing the Project Definition
If, after running the Project Inspect report, you notice that more files need to included or excluded then fix the project definition by running --update-project and then run the Project Inspect report to verify that the expected files are displayed in the report. Run the following commands until the correct files are included and excluded:
lrm --update-project -f <path to the ProjectDefinition.xml file> lrm -r --project-inspect -pn <Project Name>
Preparing a Kit
A Kit is what we call the set of resource files that are gathered by Localyzer, set out for translation, and then integrated back into the source code tree once translated. Localyzer sets and tracks versions of a Kit so that, as your developers add strings to the base resource files, you can prepare and send out the Kit multiple times. There are a variety of checks that Localyzer makes on the base resource files to ensure that they are correct, as well as tracking the progress and correctness of the translated resource files. Note: If your project contains translated files, then when prepping your first kit, Localyzer will not be able to detect if a text change has occurred within a resource string. It will, however, be able to detect added keys or missed translations.
Dry Run Kit Preparation
Once Localyzer Project's set of resource files has been validated using the --project-inspect command, create the first Kit to send out for translation, using the --prep-kit command. However, to make sure that the Kit has no errors, we recommend that first using the --dry-run option. This will go through the steps of Kit creation, including checking for errors, without actually creating the Kit and storing information in the Localyzer database.
lrm --prep-kit --dry-run --project-name <project name>
The resulting BaseFileSearch<target locale>.xml report files are located in the reports folder (<home>/Lingoport_Data/LRM/<group-name>/reports/MyProject
), unless you include the -f option to locate it elsewhere. Be sure to check all the target locale reports to make sure that the set of resource files is correct. Remember that although the first time you'll be sending out all base resource files for translation, subsequent Kit preparations will only include base resource files that have actually changed since the last time the --prep-kit command was run. In addition, if there are warnings or errors in the base resource files (the default locale), one of these report files will be created: BaseFileSearchErrors<default locale>.xml will contain both errors and warnings; BaseFileSearchWarnings<default locale>.xml will be created if there are only warnings detected. While warnings do not need to be fixed, you must correct all errors in order to create a Kit.
Base resource file errors and warnings detected are:
ENCODING - the base-file-encoding you set in your Localyzer Project's definitions xml file does not match. You should fix the encoding of the base resource file and run --prep-kit --dry-run again. DUPLICATE_KEY - there is a duplicate string key in the base resource file. Remove the duplicate and run --prep-kit --dry-run again. EMPTY_KEY - the value has no corresponding key. Either remove the value from the file or add the appropriate key. EMPTY_VALUE - the string key in the base resource file is set to an empty string. This is just a warning and will not prevent you from creating and sending out a Kit FILE_TOO_BIG - a base resource file cannot be larger than 16 megabytes. You will need to break up your resource file into multiple files and then run --prep-kit --dry-run again.
In addition to the BaseFileSearch<default locale>.xml report, if you have already run a --prep-kit command and sent files out for translation, then you may also see OutstandingPrepFiles<target locale>.xml reports in the folder. These files will contain all the resource files that have not been received back from translation and subsequently, imported into the source code. If a resource file is 'outstanding' but has changed since the last time it was sent out for translation then it will be included in the prep kit.
If there are duplicate file names, then the report DuplicatePrepFiles<target locale>.xml will be created listing the duplicate file names. This is an indication that another kit will need to be prepared after the current kit has successfully been prepped.
Kit Preparation
With the --dry-run option running successfully, you're ready to prepare a Kit for translation. You do this by running the --prep-kit command with only the Localyzer project name.
lrm --prep-kit --project-name <project name>
By default, the Kit is created under your 'prep_kit' folder,. Each time you prepare a Kit for your Localyzer project, Localyzer will create a folder named PREP_KIT_<version>,(<HOME>/Lingoport_Data/LRM/<group-name>/prep_kit/MyProject
), with all the latest settings associated with your Localyzer Project where <version> is the kit version number. For example, if you ran --prep-kit on your LRM Project named MyProject, the first Kit would be created in the folder (<HOME>/Lingoport_Data/LRM/<group-name>/prep_kit/MyProject/PREP_KIT_1
.
The PREP_KIT_<version> contains:
- A folder for each locale with a copy of each base resource file that has changed since the last time the kit was prepped. If the prep.kit.changes.only option is set in the config_lrm_info.properties file then the resource files will contain only the key/value pairs that have changed since the last time the kit was prepped;
- A BaseFileSearch<target locale>.xml file for each locale describing the base files for the kit;
- If Localyzer detected only warnings in your base resource files, then there will also be a BaseFileSearchWarnings<default locale>.xml file describing the warnings.
- However, if there are errors in the base resource files (rather than just warnings), the PREP_KIT_<version> folder will contain a BaseFileSearchErrors<default locale>.xml file and the kit will not be created. You must correct all errors prior to preparing a kit.
The PREP_KIT_<version> folder is what you send out for translation. The localization vendor will translate the resource files in each of the target locale folders.
Important Note: It is required that the resource files in the target locale folders are translated and returned, maintaining all the other text in the resource files. This is because Localyzer places a comment tag at the top of each resource file that indicates the Localyzer Project, Kit version and target locale, which Localyzer needs during the Kit Import process. An example Localyzer tag is: MyProjectName_1_5
Override Prep Kit
The override option of the prep kit command will prep a kit regardless of whether there are changes to the base resource files. The prep kit can be filtered by base resource files (--resource-file options) as well as locales (--locale option). If there are no additional options then all base resource file will be sent out for translation.
Examples:
- Create a prep kit for all base resource files
java -jar lrm-cli.jar -pk --override -pn <project> -gn <group>
- Create a prep kit for specific locales
java -jar lrm-cli.jar -pk --override -pn <project> -gn <group> --locale fr,de,es_mx
- Create a prep kit for specific resource files
java -jar lrm-cli.jar -pk -or -pn <project> -gn <group> --resource-file /var/lib/jenkins/myproject/resources/file1.properties,/var/lib/jenkins/myproject/resources/file2.properties
- Create a prep kit for a specific locale file
java -jar lrm-cli.jar -pk -or -pn <project> -gn <group> -lc fr -rf /var/lib/jenkins/myproject/resources/file3.properties