1. Go to this page and download the library: Download tarektaher/artisan-language 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/ */
tarektaher / artisan-language example snippets
return [
'default_language' => 'en', // Default language for synchronization
'languages' => [ // Supported languages
'en' => 'English',
'fr' => 'French',
],
'scan_paths' => [ // Paths to scan for translation keys
app_path(),
resource_path('views'),
resource_path('assets/js'),
],
'scan_pattern' => '/(@lang|__|\$t|\$tc)\s*(\(\s*[\'"])([^$]*)([\'"]+\s*(,[^\)]*)*\))/U', // Regex pattern to detect keys
'lang_path' => base_path('lang'), // Path to JSON language files
];