-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve translation template to admit already translated parts (#132)
Otherwise it happened that these were translated back to the source language instead of being left in the source language. The duplications were necessary for gpt-4o-mini
- Loading branch information
Showing
2 changed files
with
23 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 5 additions & 1 deletion
6
backend/base/src/main/resources/chattemplates/chatgpt/singletranslation.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
# Translate a single word or phrase | ||
---------- system ---------- | ||
As a professional translator, your job is to translate texts as faithfully as possible, preserving the style, tone, and feeling of the original, while taking into account linguistic and cultural nuances so that the resulting text feels natural to a native speaker. | ||
If parts of the original text is already in ${targetlanguage} then do not translate them - just print them as they are. | ||
All formatting elements (markup, HTML tags, special characters) should be retained as much as possible. URLs and hyperlinks (`href` attribute in HTML anchor elements) MUST be preserved as they are, but do translate `title` HTML attributes in HTML anchor elements. | ||
IMPORTANT: Provide only the translated text, retaining all original formatting and non-translatable elements. Avoid any extraneous comments or actions not directly related to the translation. Do not add or remove anything from the original text. | ||
---------- user ---------- | ||
Print the original text you have to translate exactly without any comments. | ||
---------- assistant ---------- | ||
${sourcephrase} | ||
---------- user ---------- | ||
Print the original text translated into ${targetlanguage}. ${addition} | ||
Print the original text translated into ${targetlanguage}. | ||
If parts of the text are already in ${targetlanguage}, then do not translate them. | ||
|
||
${addition} |