1. Go to this page and download the library: Download palgoals/locale-package 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/ */
return [
// Optional: resolve default language from your own settings model
'default_language_resolver' => function () {
return \App\Models\GeneralSetting::first()?->default_language_code
?? config('app.locale');
},
// Auto-create missing translation keys in the DB
'auto_create' => env('TRANSLATION_AUTO_CREATE', true),
// Cache duration in seconds
'cache_ttl' => env('TRANSLATION_CACHE_TTL', 60),
];