Difference between revisions of "XTM"

From Lingoport Wiki
Jump to: navigation, search
(Link LRM and XTM)
(One XTM Project for all Prep Kit Locales or One XTM Project for each Prep Kit Locale)
 
(50 intermediate revisions by 3 users not shown)
Line 1: Line 1:
   
 
===Link LRM and XTM===
 
===Link LRM and XTM===
  +
To begin working with XTM, create or use an existing Jenkins project configured with LRM.
 
  +
<ol>
Configure '''config_l10n_vendor.properties''' which can either be specified at the group or project level, with project level taking precedence. So either <HOME>/Lingoport_Data/L10nStreamlining/<groupname>/config/'''config_l10n_vendor.properties''' or
 
  +
<li>
<HOME>/Lingoport_Data/L10nStreamlining/<groupname>/projects/<project>/config/'''config_l10n_vendor.properties'''
 
  +
Configure <HOME>/Lingoport_Data/L10nStreamlining/config/'''config_xtm_tofrom.properties''':
:
 
  +
</li>
 
<ul>
 
<ul>
<li>uncomment '''<code>l10n.vendor=local</code>'''</li>
+
<li>configure '''<code>xtm.out.to.translation.dir</code>'''</li>
<li>configure '''<code>local.out.absolute.path</code>'''</li>
+
<li>configure '''<code>xtm.in.from.translation.dir</code>'''</li>
<li>configure '''<code>local.in.absolute.path</code>'''</li>
 
 
</ul>
 
</ul>
  +
<li>
 
  +
Create an XTM local vendor in Jenkins:
Configure <HOME>/Lingoport_Data/L10nStreamlining/config/'''config_xtm_tofrom.properties''':
 
  +
</li>
  +
<ul>
  +
<li>Select '''Manage Jenkins->Configure System'''</li>
  +
<li>Scroll down to the <b>LRM L10n Vendor Setup</b> section and select <b>Add Local Vendor</b></li>
  +
<li>Provide a unique vendor name</li>
  +
<li>Select <b>Group</b> or <b>Project</b>; if group, select group name from drop down list</li>
  +
<li>Configure Prep Kit Files Directory; this must match '''<code>xtm.out.to.translation.dir</code>''' in config_xtm_tofrom.properties</li>
  +
<li>Configure Imported Files Directory; this must match '''<code>xtm.in.from.translation.dir</code>''' in config_xtm_tofrom.properties</li>
  +
<li>Save</li>
  +
</ul>
  +
<li>
  +
Configure your Jenkins job to use XTM local vendor:
  +
</li>
 
<ul>
 
<ul>
  +
<li>Select the Jenkins job you want to use XTM</li>
<li>configure '''<code>xtm.to.translation.dir</code>'''</li>
 
  +
<li>Click Configure</li>
<li>configure '''<code>xtm.from.translation.dir</code>'''</li>
 
  +
<li>Scroll down to the <b>L10n Vendor</b> section of your LRM configuration</li>
  +
<li>Choose <b>Group</b> or <b>Project</b>; if project, click <b>Local Vendor</b> and then select the <b>Local Vendor Name</b> from the list</li>
  +
<li>Save</li>
 
</ul>
 
</ul>
  +
</ol>
  +
  +
===Configure and Enable XTM Jenkins Jobs===
  +
<ol>
  +
<li>Enable the <b>XTMCallback</b> Jenkins job and modify the token value or keep the default.</li>
  +
<li>Enable the <b>XTMCheckCallback</b> Jenkins job.</li>
  +
<li>Enable the <b>XTMSend</b> Jenkins job.</li>
  +
<li>Modify the Jenkins job <b>LocalVendorDownload</b> and check <b>Build after other projects are built</b> and then in <b>Projects to watch</b>, type in <b>XTMCallback</b>.</li>
  +
</ol>
   
 
===XTM Configuration===
 
===XTM Configuration===
   
Configure the XTM settings in the file '''<code>config_xtm_vendor.properties</code>''', located in either the group or project config directory.
+
Configure the XTM settings in the '''config_xtm_vendor.properties''' (which can be specified at the group or project config level).
 
<pre>
 
<pre>
 
#
 
#
Line 43: Line 68:
   
 
# the following are required
 
# the following are required
xtm.api.hostURL=https://wstest2.xtm-intl.com
+
xtm.api.hostURL=https://api-test.xtm-intl.com
 
xtm.api.token=
 
xtm.api.token=
 
xtm.api.id.customer=
 
xtm.api.id.customer=
 
xtm.api.source.locale=en_US
 
xtm.api.source.locale=en_US
  +
  +
# optional
  +
#xtm.api.proxyHost=example.proxy.com
  +
#xtm.api.proxyPort=3128
   
 
# one of the following must be configured
 
# one of the following must be configured
Line 54: Line 83:
   
 
# configure proper URL for your company
 
# configure proper URL for your company
xtm.api.callbackURL=http://jenkins.company.com:8080/jenkins/buildByToken/buildWithParameters/build?job=XTMCallback&token=ZISXTMTOKEN
+
xtm.api.callbackURL=http://jenkins.company.com/jenkins/buildByToken/buildWithParameters/build?job=XTMCallback&token=<the_token_configured_in_XTMCallback>
  +
  +
#
  +
# You can test your callback configuration using curl on the command line (note the escaped & before token):
  +
# curl http://jenkins.company.com/jenkins/buildByToken/buildWithParameters/build?job=XTMCallback\&token=<the_token_configured_in_XTMCallback>
  +
# A successful curl command simply returns.
  +
# An unsuccessful curl command will display an error.
  +
#
 
</pre>
 
</pre>
   
  +
===One XTM Project for all Prep Kit Locales or One XTM Project for each Prep Kit Locale ===
===XTM Locale Mapping===
 
  +
This setting is available for XTM starting with the Japan release (LRM 9.0.20). See [[Zip_Files_For_Prep_and_Import#One_Zip_File_for_all_Locales.2C_per_Prep_Kit_Number| Projects and Locales]]
XTM does not allow language only locales. If there are LRM target locales that are language-only, then a mapping between the LRM locale and the XTM locale should be entered into <code>config_xtm_locale_mapping.properties</code> file if it doesn't already exist.
 
   
  +
When sending files to XTM for a prep kit, projects are created in XTM via the XTM API. A setting allows to have one project for all the locales where the files sent to translation are the same.
The default location for the configuration file is at the group level (<HOME>/Lingoport_Data/L10nStreamlining/<group name>/config). The configuration file also exists in the LRM install directory's <code><HOME>/lingoport/lrm-server-x.y/deploy/templates/dir_structure/group/config</code> folder.
 
  +
  +
By default, when a Localyzer project is prepped, there will be one TMS project (or one zip file) per locale. If there is a need to send files for '''all''' the locales in one TMS project (or one zip file), then the
  +
* <code>prep.kit.locales.in.one.project</code> flag
  +
needs to be changed in configuration file
  +
* '''<code>config_lrm_info.properties</code>'''
  +
  +
This configuration file may reside under the group or the project config folder:
  +
* <code>/var/lib/jenkins/Lingoport_Data/L10nStreamlining/<group-name>/config</code>
  +
* <code>/var/lib/jenkins/Lingoport_Data/L10nStreamlining/<group-name>/config/<project-name></code>
  +
  +
===XTM Locale Mapping===
  +
Configure '''config_xtm_locale_mapping.properties''' (which can be specified at the group or project config level).<br>
  +
This file maps locales from LRM to XTM. For example, LRM supports the language only locale '''fr''', which must be mapped to '''fr_FR''' for XTM.
   
 
<pre>
 
<pre>
Line 75: Line 124:
 
...
 
...
 
</pre>
 
</pre>
  +
  +
===LRM Resource Types Supported by XTM===
  +
  +
XTM supports the following LRM resource types:
  +
* .html, .htm
  +
* .json
  +
* .po
  +
* .properties
  +
* .resx
  +
* .rc
  +
* .rxml
  +
* .strings
  +
* strings.xml
  +
* .txt
  +
* .yaml, .yml
  +
  +
  +
XTM does <b>not</b> support the following LRM resource types:
  +
* .rjs
  +
* .msg
  +
  +
===XTM Special Instructions - parameters (e.g. %d, etc)===
  +
XTM expects parameters in '''.strings''' resource files to be numbered.
  +
If not numbered, XTM will provide numbers during translation, which will result in a parameter mismatch error during LRM import.
  +
To avoid the error, number of the parameters in the base resource file.
  +
<br>
  +
For example, if you have the following in a .strings resource file:
  +
"Test.Key" = "Test %d and %d";
  +
It should be changed to:
  +
"Test.Key" = "Test %1$d and %2$d";
  +
  +
Note: a single parameter must be numbered. For example:
  +
"Test.Key_Single" = "Test %1$d";

Latest revision as of 15:12, 27 May 2022

Link LRM and XTM

To begin working with XTM, create or use an existing Jenkins project configured with LRM.

  1. Configure <HOME>/Lingoport_Data/L10nStreamlining/config/config_xtm_tofrom.properties:
    • configure xtm.out.to.translation.dir
    • configure xtm.in.from.translation.dir
  2. Create an XTM local vendor in Jenkins:
    • Select Manage Jenkins->Configure System
    • Scroll down to the LRM L10n Vendor Setup section and select Add Local Vendor
    • Provide a unique vendor name
    • Select Group or Project; if group, select group name from drop down list
    • Configure Prep Kit Files Directory; this must match xtm.out.to.translation.dir in config_xtm_tofrom.properties
    • Configure Imported Files Directory; this must match xtm.in.from.translation.dir in config_xtm_tofrom.properties
    • Save
  3. Configure your Jenkins job to use XTM local vendor:
    • Select the Jenkins job you want to use XTM
    • Click Configure
    • Scroll down to the L10n Vendor section of your LRM configuration
    • Choose Group or Project; if project, click Local Vendor and then select the Local Vendor Name from the list
    • Save

Configure and Enable XTM Jenkins Jobs

  1. Enable the XTMCallback Jenkins job and modify the token value or keep the default.
  2. Enable the XTMCheckCallback Jenkins job.
  3. Enable the XTMSend Jenkins job.
  4. Modify the Jenkins job LocalVendorDownload and check Build after other projects are built and then in Projects to watch, type in XTMCallback.

XTM Configuration

Configure the XTM settings in the config_xtm_vendor.properties (which can be specified at the group or project config level).

#
# Contains configuration for xtm
#
# Note: this file should be placed in ~/Lingoport_Data/L10nStreamlining/<group>/config 
#                                  or ~/Lingoport_Data/L10nStreamlining/<group>/projects/<project>/config
#
# Run the following command to get the token:
# java -jar lingoport-xtm-cli.jar --get-token -s <server> -c <client> -u <userId> -p <password> 
#
# Run the following command to get the customerId:
# java -jar lingoport-xtm-cli.jar --get-customer-id -s <server> -t <token> -cn <customerName>
#
# Run the following command to get the templateId (if using a template):
# java -jar lingoport-xtm-cli.jar --get-template-id -s <server> -t <token> -ci <customerid> -tn <templatename>
#
# Run the following command to get the workflowId (if using a workflow id):
# java -jar lingoport-xtm-cli.jar --get-workflow-id -s <server> -t <token> -wn <workflowname>
#
# Required to configure either a workflow name, workflow id, or template id
#

# the following are required
xtm.api.hostURL=https://api-test.xtm-intl.com
xtm.api.token=
xtm.api.id.customer=
xtm.api.source.locale=en_US

# optional
#xtm.api.proxyHost=example.proxy.com
#xtm.api.proxyPort=3128

# one of the following must be configured
xtm.api.name.workflow=
xtm.api.id.workflow=
xtm.api.id.template=

# configure proper URL for your company
xtm.api.callbackURL=http://jenkins.company.com/jenkins/buildByToken/buildWithParameters/build?job=XTMCallback&token=<the_token_configured_in_XTMCallback>

#
# You can test your callback configuration using curl on the command line (note the escaped & before token):
#     curl http://jenkins.company.com/jenkins/buildByToken/buildWithParameters/build?job=XTMCallback\&token=<the_token_configured_in_XTMCallback>
# A successful curl command simply returns.
# An unsuccessful curl command will display an error.
#

One XTM Project for all Prep Kit Locales or One XTM Project for each Prep Kit Locale

This setting is available for XTM starting with the Japan release (LRM 9.0.20). See Projects and Locales

When sending files to XTM for a prep kit, projects are created in XTM via the XTM API. A setting allows to have one project for all the locales where the files sent to translation are the same.

By default, when a Localyzer project is prepped, there will be one TMS project (or one zip file) per locale. If there is a need to send files for all the locales in one TMS project (or one zip file), then the

  • prep.kit.locales.in.one.project flag

needs to be changed in configuration file

  • config_lrm_info.properties

This configuration file may reside under the group or the project config folder:

  • /var/lib/jenkins/Lingoport_Data/L10nStreamlining/<group-name>/config
  • /var/lib/jenkins/Lingoport_Data/L10nStreamlining/<group-name>/config/<project-name>

XTM Locale Mapping

Configure config_xtm_locale_mapping.properties (which can be specified at the group or project config level).
This file maps locales from LRM to XTM. For example, LRM supports the language only locale fr, which must be mapped to fr_FR for XTM.

#
#Locale mapping language only locales - Locales should be in the java format (_)
# This is the default mapping. For your community, you'll need to edit this file
# and place it either at the group level or the project level.
#
aa=aa_DJ
ab=ab_GE
af=af_ZA
ak=ak_GH
am=am_ET
...

LRM Resource Types Supported by XTM

XTM supports the following LRM resource types:

  • .html, .htm
  • .json
  • .po
  • .properties
  • .resx
  • .rc
  • .rxml
  • .strings
  • strings.xml
  • .txt
  • .yaml, .yml


XTM does not support the following LRM resource types:

  • .rjs
  • .msg

XTM Special Instructions - parameters (e.g. %d, etc)

XTM expects parameters in .strings resource files to be numbered. If not numbered, XTM will provide numbers during translation, which will result in a parameter mismatch error during LRM import. To avoid the error, number of the parameters in the base resource file.
For example, if you have the following in a .strings resource file:

"Test.Key" = "Test %d and %d";

It should be changed to:

"Test.Key" = "Test %1$d and %2$d";

Note: a single parameter must be numbered. For example:

"Test.Key_Single" = "Test %1$d";