transduck 0.2.3 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -6,11 +6,12 @@
|
|
|
6
6
|
* prompt text contains ${value} patterns that must be preserved literally.
|
|
7
7
|
*/
|
|
8
8
|
const SYSTEM_TEMPLATE = 'You are a professional translator. Translate the given text from {source_lang} ' +
|
|
9
|
-
'to {target_lang}. Return ONLY the translated text, nothing else.
|
|
10
|
-
'
|
|
9
|
+
'to {target_lang}. Return ONLY the translated text, nothing else. ' +
|
|
10
|
+
'Do NOT add quotation marks, brackets, or any wrapper characters that are not in the original. ' +
|
|
11
|
+
'Preserve any placeholders like {name}, {{count}}, %s, ${value} exactly as they appear. ' +
|
|
11
12
|
'Preserve brand names. Match the tone and formality of the original.\n\n' +
|
|
12
13
|
'Project context: {project_context}';
|
|
13
|
-
const USER_TEMPLATE = 'Translate
|
|
14
|
+
const USER_TEMPLATE = 'Translate the following text:\n{source_text}\n\nString context: {string_context}';
|
|
14
15
|
const PLURAL_SYSTEM_TEMPLATE = 'You are a professional translator. You will be given two plural forms ' +
|
|
15
16
|
'(one and other) in {source_lang}. Generate ALL plural forms needed in ' +
|
|
16
17
|
'{target_lang} according to CLDR plural rules. Return ONLY a JSON object ' +
|
package/package.json
CHANGED
package/src/providers/prompts.ts
CHANGED
|
@@ -9,13 +9,14 @@
|
|
|
9
9
|
|
|
10
10
|
const SYSTEM_TEMPLATE =
|
|
11
11
|
'You are a professional translator. Translate the given text from {source_lang} ' +
|
|
12
|
-
'to {target_lang}. Return ONLY the translated text, nothing else.
|
|
13
|
-
'
|
|
12
|
+
'to {target_lang}. Return ONLY the translated text, nothing else. ' +
|
|
13
|
+
'Do NOT add quotation marks, brackets, or any wrapper characters that are not in the original. ' +
|
|
14
|
+
'Preserve any placeholders like {name}, {{count}}, %s, ${value} exactly as they appear. ' +
|
|
14
15
|
'Preserve brand names. Match the tone and formality of the original.\n\n' +
|
|
15
16
|
'Project context: {project_context}';
|
|
16
17
|
|
|
17
18
|
const USER_TEMPLATE =
|
|
18
|
-
'Translate
|
|
19
|
+
'Translate the following text:\n{source_text}\n\nString context: {string_context}';
|
|
19
20
|
|
|
20
21
|
const PLURAL_SYSTEM_TEMPLATE =
|
|
21
22
|
'You are a professional translator. You will be given two plural forms ' +
|