Difference between revisions of "Prompting"

From Lingoport Wiki
Jump to: navigation, search
(Sample PXML)
(Sample PXML)
Line 53: Line 53:
   
 
== Sample PXML ==
 
== Sample PXML ==
The PXML section will look like, if the translation level prompting is configured with <code>{{SRC}} to {{TARGET}}</code>:
+
The PXML section will look like, if the translation level prompting is configured with <code>{SRC} to {TARGET}</code>:
   
 
<pre>
 
<pre>
Line 60: Line 60:
 
<pxml>
 
<pxml>
 
<!-- system_prompt is a concatenation of the translation connection system prompt and the project prompt in Localyzer -->
 
<!-- system_prompt is a concatenation of the translation connection system prompt and the project prompt in Localyzer -->
<system_prompt><![CDATA[ As a professional translator, translate an application user interface text from {{SRC}} to {{TARGET}}. Special considerations for UI: Brevity is crucial, Clarity over creativity, Consistency with UI patterns, Action-oriented language. Return only the translated text-no explanation. The application is Globalyzer and Localyzer described here https://lingoport.com/software-localization-tools/localyzer-l10n/. ]]></system_prompt>
+
<system_prompt><![CDATA[ As a professional translator, translate an application user interface text from {SRC} to {TARGET}. Special considerations for UI: Brevity is crucial, Clarity over creativity, Consistency with UI patterns, Action-oriented language. Return only the translated text-no explanation. The application is Globalyzer and Localyzer described here https://lingoport.com/software-localization-tools/localyzer-l10n/. ]]></system_prompt>
 
<resources>
 
<resources>
 
<string translate="1" segmentID="2" minLength="" maxLength="10">
 
<string translate="1" segmentID="2" minLength="" maxLength="10">

Revision as of 22:33, 10 December 2025

Introduction

Some translation connections can take advantage of LLM style prompting. Lingoport provides the ability to pass prompting Localyzer to either TMS with LLM as part of their workflow, or directly to an LLM.

Translation Connection Level

Prompting can be passed to

  • a TMS - e.g. Trados Enterprise - using PXML
  • an LLM connection - e.g. ChatGPT

The Translation Connection Level prompt is set here:

ConnectionPrompt.png

Notes:

  • For LLMs, the variables ${SOURCE_LOCALE} and ${TARGET_LOCALE} must be part of the prompt.
  • For TMSs with PXML, check with the TMS as to how the locale code can be parameterized. It should use ${SOURCE_LOCALE} and ${TARGET_LOCALE} only when sending one prep kit per locale. The TMS may not want any indication. Or maybe parameters such as [SRC] and [TARGET] can be leverage.

Project Level Prompting

For projects on-boarded with a TMS/PXML or an LLM, the advanced settings allows for additional prompting at the project level, for all strings in that project:

ProjectPrompt.png

Context Prompting

If the translation connection is configured with an InContext server, then when a context has been associated with a string (See String Manager / Context), the context will be passed in order to provide the necessary information to better translate that string.

More Details

The prompt that is passed to an TMS or an LLM translation connection is a combination of:

  • The Translation Connection Level prompt. For example:
 As a professional translator, translate an application user interface text from ${SOURCE_LOCALE} to ${TARGET_LOCALE}. Special considerations for UI: Brevity is crucial, Clarity over creativity, Consistency with UI patterns, Action-oriented language. Return only the translated text-no explanation.
  • The Project Level Prompt: For example:
 The application is Globalyzer and Localyzer, as described here https://lingoport.com/software-localization-tools/localyzer-l10n/
  • If InContext Server has a string associated image, that image for that string: For example:
 https://poc.lingoport.io/incontext-server/lookup?token=8JZGug2O004Q6q9Z00ruO5g04Lr8w7SD&key=11405_82
  • The text to translation: For example: Strings

The resulting prompt without an image:

 As a professional translator, translate an application user interface text from English to Latin. Special considerations for UI: Brevity is crucial, Clarity over creativity, Consistency with UI patterns, Action-oriented language. Return only the translated text-no explanation. The application is Globalyzer and Localyzer, as described here https://lingoport.com/software-localization-tools/localyzer-l10n/. Now translate the following: Strings

If an image is associated, the prompt will include:

 As a professional translator, translate an application user interface text from English to Latin. Special considerations for UI: Brevity is crucial, Clarity over creativity, Consistency with UI patterns, Action-oriented language. Return only the translated text-no explanation. The application is Globalyzer and Localyzer, as described here https://lingoport.com/software-localization-tools/localyzer-l10n/. Use the image only if it is relevant to understanding the text (e.g., location, image, signs, or symbols). If the image does not correspond to the text, ignore it. Now translate the following: Strings

Sample PXML

The PXML section will look like, if the translation level prompting is configured with {SRC} to {TARGET}:


<?xml version="1.0" encoding="utf-8"?>
<pxml>
 <!-- system_prompt is a concatenation of the translation connection system prompt and the project prompt in Localyzer -->
  <system_prompt><![CDATA[ As a professional translator, translate an application user interface text from {SRC} to {TARGET}. Special considerations for UI: Brevity is crucial, Clarity over creativity, Consistency with UI patterns, Action-oriented language. Return only the translated text-no explanation. The application is Globalyzer and Localyzer described here https://lingoport.com/software-localization-tools/localyzer-l10n/.  ]]></system_prompt>
 <resources>
  <string translate="1" segmentID="2" minLength="" maxLength="10">
    <lrm_incontext>https://poc.lingoport.io/incontext-server/lookup?key=11405_82&amp;token=8JZGug2O004Q6q9Z00ruO5g04Lr8w7SD</lrm_incontext>
    <llm_prompt>Now translate the following: Strings </llm_prompt>
    <SID>KEY_17</SID>
    <value>Strings/value>
  </string>
</resources>
</pxml>