Skip to content

Commit 18b82dc

Browse files
committed
fix readme
1 parent 79cf197 commit 18b82dc

File tree

1 file changed

+27
-32
lines changed

1 file changed

+27
-32
lines changed

README.md

Lines changed: 27 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -30,22 +30,36 @@ php artisan vendor:publish --tag="translator-config"
3030
This is the contents of the published config file:
3131

3232
```php
33-
3433
return [
3534

3635
'lang_path' => lang_path(),
3736

38-
'service' => DeepLService::class,
39-
40-
'services' => [
41-
DeepLService::class => [
42-
'key' => env('DEEPL_KEY'),
37+
'translate' => [
38+
'service' => 'deepl',
39+
'services' => [
40+
'deepl' => [
41+
'key' => env('DEEPL_KEY'),
42+
],
43+
'openai' => [
44+
'model' => 'gpt-4o',
45+
'prompt' => "Translate the following json to the locale '{targetLocale}' while preserving the keys.",
46+
],
4347
],
44-
OpenAiService::class => [
45-
'model' => 'gpt-4o',
46-
'prompt' => 'Translate the following json to the locale {targetLocale} while preserving the keys.',
48+
],
49+
50+
'grammar' => [
51+
'service' => 'openai',
52+
'services' => [
53+
'openai' => [
54+
'model' => 'gpt-4o',
55+
'prompt' => '
56+
Fix the grammar and the syntax the following json string while preserving the keys.
57+
Do not change the meaning or the tone of the sentences and never change the keys.
58+
',
59+
],
4760
],
4861
],
62+
4963
];
5064
```
5165

@@ -100,36 +114,17 @@ First, you need to edit the config file to add your DeepL api key and select dee
100114

101115
```php
102116
return [
103-
104-
'lang_path' => lang_path(),
105-
106117
'translate' => [
107-
'service' => 'deepl',
118+
'service' => 'deepl', // select the default service here
119+
108120
'services' => [
109121
'deepl' => [
110-
'key' => env('DEEPL_KEY'),
122+
'key' => env('DEEPL_KEY'), // add you api key here
111123
],
112-
'openai' => [
113-
'model' => 'gpt-4o',
114-
'prompt' => "Translate the following json to the locale '{targetLocale}' while preserving the keys.",
115-
],
116-
],
117-
],
118124

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-
],
129125
],
130126
],
131-
132-
];
127+
]
133128
```
134129

135130
To translate all the missing translations use:

0 commit comments

Comments
 (0)