Localyzer Configuration FAQ

From Lingoport Wiki
Revision as of 21:06, 20 April 2017 by Olibouban (talk | contribs) (Resource Manager Project Creation)
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

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. See an example of the Project Definition File below (Resource Manager Project Sample Definition)


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

 %LRM_CMD% --create-project -f project_definition.xml

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

 %LRM_CMD% --prep_config --dry-run --project-name project_name 

It will create one file per locale under the reports\project_name directory.

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

 %LRM_CMD% --export-project --project-name project_name

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

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

  %LRM_CMD% --update-project project_definition.xml

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

 %LRM_CMD% --list-projects

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.

Resource Manager Project Sample Definition

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):

<code>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<lrmconf>
  <model-version>3.1.14</model-version>
  <project-name>SampleLRM</project-name>
  <project-desc>This is a sample LRM Project definition file, configured to support Java properties files</project-desc>
  <!--group-name contains either the company name or the group name-->
  <group-name>Lingoport</group-name>
  <top-level-dir>/var/lib/jenkins/jobs/Lingoport.SampleLRM/workspace</top-level-dir>
  <detect-errors>
    <missed-trans-error>0</missed-trans-error>
    <parameter-mismatch-error>1</parameter-mismatch-error>
  </detect-errors>
  <track-back-locale>br</track-back-locale>
  <pseudo-locale/>
  <target-locales>
    <locale>fr_FR</locale>
    <locale>de_DE</locale>
  </target-locales>
  <default-locale>en_US</default-locale>
  <resource-extensions>
    <resource-extension>
      <extension>properties</extension>
      <file-name-pattern>*_l_c_v</file-name-pattern>
      <use-pattern-on-dflt-locale>1</use-pattern-on-dflt-locale>
      <file-location-pattern/>
      <use-location-pattern-on-dflt-locale>0</use-location-pattern-on-dflt-locale>
      <base-file-encoding>UTF-8</base-file-encoding>
      <localized-file-encoding>UTF-8</localized-file-encoding>
      <parameter-regex-pattern><![CDATA[\{\w+\}|%[ds]]]></parameter-regex-pattern>
    </resource-extension>
  </resource-extensions>
  <dirset>
      <include-dir>**/**</include-dir>
    </includes>
    <excludes>
      <exclude-dir-file>**/src/test/**</exclude-dir-file>
      <exclude-dir-file>**/bin/**</exclude-dir-file>
      <exclude-dir-file>**/target/**</exclude-dir-file>
      <exclude-dir-file>**/catalina.properties</exclude-dir-file>
      <exclude-dir-file>**/quartz.properties</exclude-dir-file>
    </excludes>
  </dirset>
</lrmconf>
</code>