Skip to content

Commit

Permalink
fix readme
Browse files Browse the repository at this point in the history
  • Loading branch information
QuentinGab committed Jun 20, 2024
1 parent 79cf197 commit 18b82dc
Showing 1 changed file with 27 additions and 32 deletions.
59 changes: 27 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,36 @@ php artisan vendor:publish --tag="translator-config"
This is the contents of the published config file:

```php

return [

'lang_path' => lang_path(),

'service' => DeepLService::class,

'services' => [
DeepLService::class => [
'key' => env('DEEPL_KEY'),
'translate' => [
'service' => 'deepl',
'services' => [
'deepl' => [
'key' => env('DEEPL_KEY'),
],
'openai' => [
'model' => 'gpt-4o',
'prompt' => "Translate the following json to the locale '{targetLocale}' while preserving the keys.",
],
],
OpenAiService::class => [
'model' => 'gpt-4o',
'prompt' => 'Translate the following json to the locale {targetLocale} while preserving the keys.',
],

'grammar' => [
'service' => 'openai',
'services' => [
'openai' => [
'model' => 'gpt-4o',
'prompt' => '
Fix the grammar and the syntax the following json string while preserving the keys.
Do not change the meaning or the tone of the sentences and never change the keys.
',
],
],
],

];
```

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

```php
return [

'lang_path' => lang_path(),

'translate' => [
'service' => 'deepl',
'service' => 'deepl', // select the default service here

'services' => [
'deepl' => [
'key' => env('DEEPL_KEY'),
'key' => env('DEEPL_KEY'), // add you api key here
],
'openai' => [
'model' => 'gpt-4o',
'prompt' => "Translate the following json to the locale '{targetLocale}' while preserving the keys.",
],
],
],

'grammar' => [
'service' => 'openai',
'services' => [
'openai' => [
'model' => 'gpt-4o',
'prompt' => '
Fix the grammar and the syntax the following json string while preserving the keys.
Do not change the meaning or the tone of the sentences and never change the keys.
',
],
],
],

];
]
```

To translate all the missing translations use:
Expand Down

0 comments on commit 18b82dc

Please sign in to comment.