1. Go to this page and download the library: Download syriable/localizator library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
syriable / localizator example snippets
// config/localizator.php
return [
// Translation file type: 'default' (PHP) or 'json'
'localize' => env('LOCALIZATOR_TYPE', 'default'),
// Source language for AI translations
'source_language' => env('LOCALIZATOR_SOURCE_LANG', 'en'),
// Use nested array structure for dot notation keys
'nested' => true,
// Directories to scan for translation functions
'dirs' => [
app_path(),
resource_path('views'),
resource_path('js'),
resource_path('vue'),
base_path('routes'),
],
// File patterns to l' => env('OPENAI_MODEL', 'gpt-3.5-turbo'),
],
'claude' => [
'api_key' => env('ANTHROPIC_API_KEY'),
'model' => env('CLAUDE_MODEL', 'claude-3-sonnet-20240229'),
],
// ... more AI provider configurations
],
];
bash
# Generate for default locales (configured in config/localizator.php)
php artisan localizator:generate
# Generate for specific locales
php artisan localizator:generate en es fr de
# Silent mode (no output except errors)
php artisan localizator:generate --silent
# With AI auto-translation
php artisan localizator:generate es fr --auto-translate
# Generate JSON files instead of PHP
php artisan localizator:generate en --format=json
# Force overwrite without backup
php artisan localizator:generate en --force