Skip to main content

Add context for translators to your strings

A word on its own is often ambiguous. "Frame" can be a noun or a verb, "Range" can be a distance or a set of values, and "Power" could be optical or electrical. A translator looking at a list of short UI strings has no way to tell, and neither has the AI.

If you write a short note for each string, Taia passes it on: translators see it right under the segment in the editor, and Advanced and Premium AI read it before they translate. The note itself is never translated, and the file you download keeps it exactly as you wrote it.

Prerequisites​

  • A file in a format that carries notes: XLIFF 1.2 (.xlf, .xliff), Qt Linguist (.ts) or PO. XLIFF and PO files need Pro or Enterprise. Qt .ts files work on every plan, Free included.

Write the notes in your file​

XLIFF​

Add a <note> inside each <trans-unit>:

<trans-unit id="toolbar.lift">
<source>Lift</source>
<target/>
<note from="developer">Verb, on a button: starts the take-off. The button is 90 px wide.</note>
</trans-unit>

You can add more than one <note>; translators see them one per line. The from and annotates attributes are optional, and every note is shown whatever they say. A note with from="reference" is the exception: that's usually a source-code location such as src/toolbar.cpp:212, which doesn't help a translator, so it's left out.

If you export XLIFF from Qt with lconvert, the developer comments in your .ts file already arrive as <note> elements, so there is nothing extra to do.

Qt Linguist (.ts)​

Write the note in your source code. A //: comment ends up as <extracomment> in the .ts file, and the second argument of tr() (the disambiguation) as <comment>:

//: Starts the take-off. The button is 90 px wide.
tr("Lift", "verb");

Both are shown, one per line.

PO​

Use an extracted comment, the line that starts with #.:

#. Column header: how far the car can fly on a full battery, in km.
msgid "Range"
msgstr ""

Translator comments (lines that start with # ) are shown too. Source references (#: lines) aren't, for the same reason as from="reference" above. For a plural entry, translators also see the plural form of the source, as "Plural form:" followed by the msgid_plural text.

What translators see​

Open the job in the editor. Each note appears under its source text, labeled Developer note.

The editor with two short source strings, Lift, already translated, and Range, not translated yet. Under each one, a gray line starting with Developer note explains it, for example: Verb, on a button: starts the vertical take-off. Keep it short, the button is 90 px wide.

A long note shows its first two lines. Select the segment to read it in full. Notes longer than 2,000 characters are shortened.

Notes are read-only. They come from your file, so they don't appear among the comments, and nobody can change them in the editor. To change a note, change it in your file; the next version you upload carries the new one.

How the AI uses the note​

When you translate with Advanced or Premium AI, each string goes to the AI together with its note, as guidance on meaning, part of speech and length. The AI is told not to translate the note or copy it into the translation.

Standard AI doesn't use notes. Translators and reviewers see them whichever AI you choose.

What you get back​

The translated file keeps every note on the same string, word for word, so you can send the next version through the same process.

If your integration uses Strings and sends a context for an entry, Taia treats it the same way: translators see it under the string, and Advanced and Premium AI read it.