Difference between revisions of "PXML"

From Lingoport Wiki
Jump to: navigation, search
(PXML File Format)
Line 27: Line 27:
   
 
<?xml version="1.0" encoding="utf-8"?>
 
<?xml version="1.0" encoding="utf-8"?>
<!--TestANDROID_Context_1_185 - FULL-FILE-->
 
 
<resources>
 
<resources>
<string translate="Yes" SID="Shipped" segmentID="1" minLength="" maxLength="10"
+
<string translate="1" segmentID="1" minLength="" maxLength="">
LRM_INCONTEXT="https://poc.lingoport.io/incontext-server/lookup?token=8JZGug2O004Q6q9Z00ruO5g04Lr8w7SD&amp;key=116_22">
+
<lrm_incontext>https://poc.lingoport.io/incontext-server/lookup?key=1570_105&amp;token=8JZGug2O004Q6q9Z00ruO5g04Lr8w7SD</lrm_incontext>
<llm_prompt>The product has ship date, as in sent date.</llm_prompt>
+
<llm_prompt></llm_prompt>
  +
<SID>DUM-S</SID>
Shipped
 
  +
<value>DUM-series Droid</value>
 
</string>
 
</string>
  +
<string translate="1" segmentID="2" minLength="" maxLength="40">
 
  +
<lrm_incontext>https://poc.lingoport.io/incontext-server/lookup?key=1573_105&amp;token=8JZGug2O004Q6q9Z00ruO5g04Lr8w7SD</lrm_incontext>
<string translate="Yes" SID="ETA2" segmentID="2" minLength="5" maxLength="25"
 
  +
<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>
LRM_INCONTEXT="https://poc.lingoport.io/incontext-server/lookup?token=8JZGug2O004Q6q9Z00ruO5g04Lr8w7SD&amp;key=9_22">
 
  +
<SID>CORVETTE-003</SID>
<llm_prompt>Use a neutral tone and avoid slang.</llm_prompt>
 
  +
<value>Sphyrna Corvette</value>
ETA-2 Interceptor
 
 
</string>
 
</string>
 
</resources>
 
</resources>
  +
   
 
</pre>
 
</pre>

Revision as of 14:35, 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 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>


  • TestANDROID_Context_1_185 - FULL-FILE is the tag as an XML comment for validation and checking of translated file
  • <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.
  • 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.