Localyzer Configuration FAQ

From Lingoport Wiki
Revision as of 22:38, 14 September 2012 by Olibouban (talk | contribs) (Resource Manager Project Definition & Configuration)
Jump to: navigation, search


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


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% --report --import-issues --project-name project_name -fC:\tmp

Resource Manager Project Definition & 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 definitions, type the following command:

 %LRM_CMD% --create-project 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"?>
<lrmconf>
     <model-version>1.0.0</model-version>
	 <kit-project-name>ResourceManagerAcmeProject</kit-project-name>
	 <kit-desc>This Acme application configuration handles the French for France (fr_FR) and the German for Germany (de_DE) locales for .properties and .resx files under the Acme src directory, to the exclusion of the test directory.</kit-desc>
      <top-level-dir>Acme/src</top-level-dir>
      <target-locales>
         <locale>fr_FR</locale>
         <locale>de_DE</locale>		
       </target-locales>
	  <default-locale>en_US</default-locale>
      <resources-extensions>
          <resource-extension>
              <extension>properties</extension>
              <file-name-pattern>*_l_c_v</file-name-pattern>
              <use-pattern-on-dflt-locale>0</use-pattern-on-dflt-locale>				  
              <file-location-pattern></file-location-pattern>
	   </resource-extension>
       </resources-extensions>
      <dirset>
         <include>
            <include-dir>**/src/**</include-dir>
         </include>
         <exclude>
            <exclude-dir>**/test/**</exclude-dir>
         </exclude>
      </dirset>
</lrmconf>

</code>