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 step is optional but recommended if you want to customize the package's behavior. It will create a `config/ai-translator.php` file where you can modify various settings.
@@ -116,36 +116,30 @@ return [
116
116
```
117
117
118
118
The package will generate translations like these:
119
-
120
-
Korean (ko-kr):
121
-
122
-
```php
123
-
<?php
124
-
return array (
125
-
'notifications.new_feature_search_sentence' => '새로운 기능: 이제 단어뿐만 아니라 문장도 입력할 수 있어요. 심지어 여러분의 언어로도 가능해요.',
126
-
'notifications.refresh_after_1_min' => '1분 후에 새로고침하세요. 새로운 내용이 준비될 거예요! (이전 모델: :model, 업데이트: :updated_at)',
| anthropic |**claude-3-haiku-20240307**|$0.25 / $1.25 | Low quality, but better than gpt-3.5 |
166
+
| openai |**gpt-4o**|$5.00 / $15.00 | Balanced quality and high speed |
167
+
| openai | gpt-4-turbo | Expensive more than gpt-4o | Low quality like 3.5. Don't use this. |
168
+
| openai | gpt-3.5-turbo | $0.50 / $1.50 | Low quality. Use for testing purpose. |
175
169
176
170
4. `locale_names`: This mapping of locale codes to language names enhances translation quality by providing context to the AI.
177
171
@@ -220,38 +214,24 @@ Currently, this package only supports PHP language files used by Laravel. JSON l
220
214
221
215
We recommend using PHP files for managing translations, especially when dealing with multiple languages. Here's why:
222
216
223
-
1. **Structure
224
-
**: PHP files allow for a more organized structure with nested arrays, making it easier to group related translations.
217
+
1. **Structure**: PHP files allow for a more organized structure with nested arrays, making it easier to group related translations.
225
218
226
219
2. **Comments**: You can add comments in PHP files to provide context or instructions for translators.
227
220
228
221
3. **Performance**: PHP files are slightly faster to load compared to JSON files, as they don't require parsing.
229
222
230
-
4. **Flexibility
231
-
**: PHP files allow formore complex operations, such as using variables or conditionsin your translations.
223
+
4. **Flexibility**: PHP files allow formore complex operations, such as using variables or conditionsin your translations.
232
224
233
-
5. **Scalability
234
-
**: When managing a large number of translations across multiple languages, the directory structure of PHP files makes it easier to navigate and maintain.
225
+
5. **Scalability**: When managing a large number of translations across multiple languages, the directory structure of PHP files makes it easier to navigate and maintain.
235
226
236
227
If you're currently using JSON files for your translations, we recommend migrating to PHP files for better compatibility with this package and improved manageability of your translations.
237
228
238
229
## AI Service
239
230
240
231
This package supports both OpenAI's GPT models and Anthropic's Claude for translations, each with its own strengths:
241
232
242
-
- OpenAI:
243
-
- GPT-4o: Optimized for speed and efficiency. Ideal for short-form translations and high-volume tasks. It offers a great balance of speed and quality.
244
-
- GPT-4: Provides high-quality translations with good understanding of context.
245
-
- GPT-3.5: Faster and more cost-effective, suitable for simpler translation tasks.
246
-
247
-
- Anthropic:
248
-
- Claude: Excels at translating longer texts and producing more natural-sounding translations. It's slower compared to GPT models but can handle complex, nuanced content better.
249
-
250
-
Choose your model based on your specific needs:
251
-
252
-
- For quick translations of short texts or UI elements, GPT-4o or GPT-3.5 might be your best bet.
253
-
- For longer content where nuance and natural flow are crucial, Claude could be the better choice.
254
-
- If you need a balance of speed and quality for mixed content, GPT-4 is a solid all-rounder.
0 commit comments