You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This will create a `config/ai-translator.php` file where you can modify the following settings:
215
215
216
-
- `source_locale`: Change this to your default language in the Laravel project. The package will translate from this language.
217
-
218
216
- `source_directory`: If you use a different directory for language files instead of the default `lang` directory, you can specify it here.
219
217
220
-
- `chunk_size`: Set the number of strings to be translated in a single AI request. Higher values can significantly reduce API costs but may impact translation quality for very large chunks. Default is 10.
221
-
222
218
- `ai`: Configure the AI provider, model, and API key here. Here are our recommendation for the best models:
223
219
224
220
| Provider | Model | Cost (I/O per 1M tokens) | Descrpition |
$this->sourceLocale = $this->choiceLanguages("Choose a source language to translate from", false, 'en');
293
+
294
+
if ($this->ask('Do you want to add reference languages? (y/n)', 'n') === 'y') {
295
+
$this->referenceLocales = $this->choiceLanguages("Choose a language to reference when translating, preferably one that has already been vetted and translated to a high quality. You can select multiple languages via ',' (e.g. '1, 2')", true);
296
+
}
297
+
298
+
$this->chunkSize = $this->ask("Enter the chunk size for translation. Translate strings in a batch. The higher, the cheaper. (default: 10)", 10);
293
299
$this->translate();
294
300
}
295
301
@@ -391,6 +397,25 @@ protected static function getAdditionalRules($locale): array {
0 commit comments