PXML

From Lingoport Wiki
Revision as of 19:55, 12 May 2025 by Olibouban (talk | contribs)
Jump to: navigation, search

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"?>
<!--TestANDROID_Context_1_185 - FULL-FILE-->
<resources>
  <string translate="Yes" SID="Shipped" segmentID="1" minLength="" maxLength="10" 
          LRM_INCONTEXT="https://poc.lingoport.io/incontext-server/lookup?token=8JZGug2O004Q6q9Z00ruO5g04Lr8w7SD&key=116_22">
    <llm_prompt>The product has ship date, as in sent date.</llm_prompt>
    Shipped
  </string>

  <string translate="Yes" SID="ETA2" segmentID="2" minLength="5" maxLength="25" 
          LRM_INCONTEXT="https://poc.lingoport.io/incontext-server/lookup?token=8JZGug2O004Q6q9Z00ruO5g04Lr8w7SD&key=9_22">
    <llm_prompt>Use a neutral tone and avoid slang.</llm_prompt>
    ETA-2 Interceptor
  </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.