Difference between revisions of "PXML"

From Lingoport Wiki
Jump to: navigation, search
(PXML File Format)
(PXML Naming Convention)
Line 20: Line 20:
 
Any file sent to the TMS will be converted to a PXML file format.
 
Any file sent to the TMS will be converted to a PXML file format.
   
== PXML Naming Convention ==
+
== PXML File Naming Convention ==
 
Repository files converted to PXML can be of many standard resource file types, such as:
 
Repository files converted to PXML can be of many standard resource file types, such as:
 
* JSON
 
* JSON

Revision as of 14:48, 14 May 2025

Introduction

Resource files for software localization come in different standard format, such as JSON, .resx, .properties and so on. To simplify showing context in a TMS or in a CAT tool like Trados Studio, best is to send strings to be translated as PXML file, i.e. Preview XML. This is a Lingoport format.

Main advantages:

  • The URL for the context on InContext server is easily parsed
  • Files like JSON without support for comments are not well suited to pass attributes such as context URLs
  • The parsing on the TMS or CAT tool is for one file format, not for all the different resource file types, so one parser/filter configuration
  • Other attributes coming from Command Center can also be associated

Configuration

The prerequisites for sending context are the following:

  • an InContext server configured
  • a TMS configuration pointing to the InContext server
  • a Localyzer project configured with that TMS

In TMS configuration, check the "Convert to PXML" checkbox.

Any file sent to the TMS will be converted to a PXML file format.

PXML File Naming Convention

Repository files converted to PXML can be of many standard resource file types, such as:

  • JSON
  • resx
  • properties
  • YML
  • .strings
  • xml (many schemas here)
  • etc.

Also, some of the files to be translated may have the same name, but be placed in different directory. A typical case is 'en.json'.

For those reasons, in order to know which converted PXML corresponds to which repository files, the naming convention looks like:

  • lrmjson_LID349823_message.pxml

where the prefix indicates the source file format (here json), an ID of the path in the repo (here 349823), and the file name root itself (here message).

PXML File Format

The following describes the PXML file format:


<?xml version="1.0" encoding="utf-8"?>
<resources>
  <string translate="1" segmentID="1" minLength="" maxLength="">
    <lrm_incontext>https://poc.lingoport.io/incontext-server/lookup?key=1570_105&token=8JZGug2O004Q6q9Z00ruO5g04Lr8w7SD</lrm_incontext>
    <llm_prompt></llm_prompt>
    <SID>DUM-S</SID>
    <value>DUM-series Droid</value>
  </string>
  <string translate="1" segmentID="2" minLength="" maxLength="40">
    <lrm_incontext>https://poc.lingoport.io/incontext-server/lookup?key=1573_105&token=8JZGug2O004Q6q9Z00ruO5g04Lr8w7SD</lrm_incontext>
    <llm_prompt>Measuring 150 meters in length, it features two dual and four single turbolaser turrets, and has the ability to reach a maximum speed of 950 kph. </llm_prompt>
    <SID>CORVETTE-003</SID>
    <value>Sphyrna Corvette</value>
  </string>
</resources>



  • <string>: the string element contains the items to translated with a number of associated attributes
    • SID: the unique segment identifier for that string, in effect the key for that string value.
    • translate: Upcoming, for now always 1 meaning the value is to be translated. 0 means do not translate this string.
    • segmentID: a placeholder, for now a counter starting at 1 in the PXML file and incremented for each <string> element
    • minLength: Upcoming - an optional value for the minimum length of the string. This optional attribute would be set in String Manager
    • maxLength: Upcoming - an optional value for the maxmim length of the string. This optional attribute would be set in String Manager
    • lrm_incontext: the URL to the context associated with that string
    • llm_prompt: Upcoming - an optional prompt to help translate the value
    • value: the string to be translated.
    • TestANDROID_Context_1_185 - FULL-FILE is the tag as an XML comment for validation and checking of translated file