Localyzer Configuration FAQ

From Lingoport Wiki
Jump to: navigation, search

Resource Manager 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.

Reports Location

The default report location is defined in the application.properties. However, each report can be generated in the different location using the -f flag. To get a translation status generated in /tmp for instance, use the -f /tmp parameter, as in:

 $LRM_CMD --report --import-issues --project-name project_name -f /tmp

Resource Manager Project Creation Commands

Note: the following commands are based on an alias for lrm on Linux along those lines:

 alias lrm='java -jar /var/lib/jenkins/lingoport/lrm-server-3.1/lrm-cli.jar' 

A project must be created under a licensed group.

To create a project in LRM, edit a project definition file and run the LRM --create-project command. In the Samples directory, you will find examples of some configurations. Copy one such file from the Samples directory and adjust the parameters. See an example of the Project Definition File below (Resource Manager Project Sample Definition). We recommend having a directory named project_definitions under Jenkins home directory (e.g. /var/lib/jenkins).

To configure the LRM project, type the following command:

 lrm --create-project --group-name group_name -f project_definition.xml

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

 lrm --report --project-inspect --group-name group_name --project-name project_name 

It will create a report per locale and echo on the Console the locations of the reports.

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

 lrm --export-project --group-name group_name --project-name project_name

This may come in handy when you want to modify an existing configuration.

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

  lrm --group-name group_name --update-project -f project_definition.xml

To see what projects are configured in the Resource Manager, type:

 lrm --group-name group_name --list-projects

Resource Manager Project Definition

Sample File

The following project definition gives shows how a Java project is defined for properties files under the 'src' directories but not the 'test' directories, two target locales (French for France and German in Germany):

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
  <project-desc>Lingoport SampleLRM Project fr_FR and de_DE Java properties files</project-desc>


This section explains the XML elements of the Project Definition File.

  • group-name: A project get created in a licensed group. A full name will be group-name.project-name.
  • project-name: A project get created in a licensed group. A full name will be group-name.project-name.
  • project-desc: this is free text for the project description
  • top-level-dir: the files to analyze are located under the repository local top level directory
  • 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:
    • <target-locale>fr_FR</target-locale
    • <target-locale>jp_JA</target-locale
  • default-locale: the locale of the files to be translated
  • resource-extensions: The list of resource extension types to support for this project
  • resource-extension: one of the extension type to handle in this project
    • extension one of the supported resource file type, such as properties or resx.
    • file-name-pattern how the locale is added to the file name if the file name reflects the locale. It may not, in which case this element is empty
      • l is for language
      • c is for country
      • 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.
    • use-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.
    • file-location-pattern is used when directories (not file names) are suffixed based on a pattern.
    • use-location-pattern-on-dflt-locale in case the directory where the files to be translated are located follows some locale naming convention.
    • base-file-encoding the encoding of the files to translate
    • localized-file-encoding the encoding of the translated files
    • parameter-regex-pattern the regexp to determine if a pattern represents a parameter, such as {parameterName} in some frameworks. For more on this, click the Parameter Regex page.
  • dirset: is an Ant like directive to include or exclude directories or files from the kit creation.