Skip to content

Commit 4fe4825

Browse files
committed
fix
1 parent 1c40521 commit 4fe4825

File tree

2 files changed

+24
-6
lines changed

2 files changed

+24
-6
lines changed

README.md

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,17 +100,36 @@ First, you need to edit the config file to add your DeepL api key and select dee
100100

101101
```php
102102
return [
103-
'translate' => [
104-
'service' => 'deepl', // select the default service here
105103

104+
'lang_path' => lang_path(),
105+
106+
'translate' => [
107+
'service' => 'deepl',
106108
'services' => [
107109
'deepl' => [
108-
'key' => env('DEEPL_KEY'), // add you api key here
110+
'key' => env('DEEPL_KEY'),
111+
],
112+
'openai' => [
113+
'model' => 'gpt-4o',
114+
'prompt' => "Translate the following json to the locale '{targetLocale}' while preserving the keys.",
109115
],
116+
],
117+
],
110118

119+
'grammar' => [
120+
'service' => 'openai',
121+
'services' => [
122+
'openai' => [
123+
'model' => 'gpt-4o',
124+
'prompt' => '
125+
Fix the grammar and the syntax the following json string while preserving the keys.
126+
Do not change the meaning or the tone of the sentences and never change the keys.
127+
',
128+
],
111129
],
112130
],
113-
]
131+
132+
];
114133
```
115134

116135
To translate all the missing translations use:

config/translator.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@
2626
'model' => 'gpt-4o',
2727
'prompt' => '
2828
Fix the grammar and the syntax the following json string while preserving the keys.
29-
Do not change the meaning or the tone of the sentences.
30-
Your answer must always be a valid and parsable json string.
29+
Do not change the meaning or the tone of the sentences and never change the keys.
3130
',
3231
],
3332
],

0 commit comments

Comments
 (0)