PHP code example of smmahfujurrahman / localization

1. Go to this page and download the library: Download smmahfujurrahman/localization 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/ */

    

smmahfujurrahman / localization example snippets


return [
    // Directory scanned by localization:wrap (default: resources/views)
    'views_path' => resource_path('views'),

    // Directory used by localization:extract and localization:sort
    // null = auto-detect (/lang on Laravel 9+, /resources/lang on older)
    'lang_path' => null,

    // Microsecond delay between Google Translate API calls (default: 100ms)
    'translate_delay' => 100000,

    // Backup directory prefix for localization:wrap (null = auto-generate)
    'backup_path' => null,

    // Filename for the empty key template (no language argument)
    'template_filename' => 'template_empty.json',

    // Source language for Google Translate (null = auto-detect)
    'source_language' => 'en',
];
bash
php artisan vendor:publish --tag=localization-config
bash
php artisan localization:sort ar.json
php artisan localization:sort fr.json
php artisan localization:sort en.json