How to improve translation quality when using OpenAI's language model?

When using OpenAI's large language models for machine translation, sometimes not only the source text is translated, but markup can also be altered unexpectedly - or some text may remain untranslated if it is mistaken for markup.

Example:

en-US (source): "<1>File copied.</1> {Close}"
de-DE (OpenAI): "<1>Datei kopiert.<\/1> {Close}"

Here, the closing tag </1> has an extra backslash, and the text inside the braces {Close} wasn’t translated.

To fix this, you can provide a context string to the translation service. Click Configuration in the toolbar and enter the following Context in the Machine translation section:

<\/0><\/1> are incorrect, return them as </0></1>.
Translate text inside {}.

With this context, the translation will correctly preserve markup and translate the text inside braces:

en-US (source): "<1>File copied.</1> {Close}"
de-DE (OpenAI): "<1>Datei kopiert.</1> {Schließen}"