transduck 0.2.3 → 0.2.5
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.
- package/README.md +2 -1
- package/dist/cli.js +1 -1
- package/dist/providers/prompts.js +4 -3
- package/package.json +1 -1
- package/src/cli.ts +1 -1
- package/src/providers/prompts.ts +4 -3
package/README.md
CHANGED
|
@@ -28,7 +28,8 @@ await aitPlural('{count} night', '{count} nights', 7); // → "7 Nächte"
|
|
|
28
28
|
## Quick Start
|
|
29
29
|
|
|
30
30
|
```bash
|
|
31
|
-
npm install transduck
|
|
31
|
+
npm install -g transduck # CLI — works everywhere
|
|
32
|
+
npm install transduck # Per-project — for importing in your code
|
|
32
33
|
transduck init
|
|
33
34
|
```
|
|
34
35
|
|
package/dist/cli.js
CHANGED
|
@@ -454,7 +454,7 @@ export async function runStats(opts) {
|
|
|
454
454
|
}
|
|
455
455
|
// CLI entry point
|
|
456
456
|
const program = new Command();
|
|
457
|
-
program.name('transduck').description('AI-native translation tool').version('0.
|
|
457
|
+
program.name('transduck').description('AI-native translation tool').version('0.2.5');
|
|
458
458
|
program.command('init')
|
|
459
459
|
.description('Initialize a new transduck project')
|
|
460
460
|
.action(async () => {
|
|
@@ -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/cli.ts
CHANGED
|
@@ -562,7 +562,7 @@ export async function runStats(opts: StatsOptions): Promise<string> {
|
|
|
562
562
|
// CLI entry point
|
|
563
563
|
const program = new Command();
|
|
564
564
|
|
|
565
|
-
program.name('transduck').description('AI-native translation tool').version('0.
|
|
565
|
+
program.name('transduck').description('AI-native translation tool').version('0.2.5');
|
|
566
566
|
|
|
567
567
|
program.command('init')
|
|
568
568
|
.description('Initialize a new transduck project')
|
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 ' +
|