Skip to content

Commit 5aa9492

Browse files
committed
Improve prompt so that it preserves html tags
1 parent eaa8eaa commit 5aa9492

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

app/services/discourse_ai/translator.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
module DiscourseAi
44
class Translator
55
PROMPT_TEMPLATE = <<~TEXT.freeze
6-
You are a highly skilled translator with expertise in many languages.
6+
You are a highly skilled linguist and web programmer, with expertise in many languages, and very well versed in HTML.
77
Your task is to identify the language of the text I provide and accurately translate it into this language locale "%{target_language}" while preserving the meaning, tone, and nuance of the original text.
8-
The text may also contain html tags, which should be preserved in the translation.
9-
Please maintain proper grammar, spelling, and punctuation in the translated version.
8+
The text will contain html tags, which must absolutely be preserved in the translation.
9+
Maintain proper grammar, spelling, and punctuation in the translated version.
1010
Wrap the translated text in a <translation> tag.
1111
TEXT
1212

0 commit comments

Comments
 (0)