add locale manager

This commit is contained in:
2024-03-27 13:56:52 +05:00
parent 7edca39546
commit 7443ff19d6
23 changed files with 845 additions and 497 deletions

View File

@@ -91,6 +91,12 @@ return [
'en' => 'English',
],
'locale_app' => [
'path' => env('LOCALE_APP_PATH', ''),
'url' => env('LOCALE_APP_URL', ''),
'api_token' => env('LOCALE_APP_API_TOKEN', ''),
],
/*
|--------------------------------------------------------------------------
| Application Fallback Locale

View File

@@ -1,77 +0,0 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Determine the paths
|--------------------------------------------------------------------------
|
*/
'paths' => [
'lang_folder' => base_path('lang'),
],
/*
|--------------------------------------------------------------------------
| The search options
|--------------------------------------------------------------------------
|
*/
'search' => [
/*
|--------------------------------------------------------------------------
| The folders the package uses to scan for translation keys
|--------------------------------------------------------------------------
|
*/
'folders' => [
base_path('app'),
resource_path('views'),
],
/*
|--------------------------------------------------------------------------
| Enter specific files
|--------------------------------------------------------------------------
|
*/
'files' => [
],
/*
|--------------------------------------------------------------------------
| The folders the package excludes from scanning
|--------------------------------------------------------------------------
|
*/
'exclude' => [
'storage',
],
/*
|--------------------------------------------------------------------------
| The files the package uses to scan for translation keys
|--------------------------------------------------------------------------
|
*/
'file_extension' => [
'*.php',
'*.js',
],
],
/*
|--------------------------------------------------------------------------
| The methods used to translate keys
|--------------------------------------------------------------------------
|
*/
'translation_methods' => [
'\$t',
'i18n.t',
'@lang',
'__',
'trans_choice',
],
];

74
config/translations.php Normal file
View File

@@ -0,0 +1,74 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Source Language
|--------------------------------------------------------------------------
|
| This is the language that will be used as the source language for
| the translations. This language will be used to import the
| translations from the files.
|
*/
'source_language' => env('TRANSLATIONS_SOURCE_LANGUAGE', 'en'),
/*
|--------------------------------------------------------------------------
| Exclude Files
|--------------------------------------------------------------------------
|
| The following files will be ignored during the import process.
| and those files will be ignored in every language.
|
*/
'exclude_files' => [
//'validation.php', // Exclude default validation for example.
],
/*
|--------------------------------------------------------------------------
| Laravel Translations Path
|--------------------------------------------------------------------------
|
| The default is `translations` but you can change it to whatever works best and
| doesn't conflict with the routing in your application.
|
*/
'path' => env('TRANSLATIONS_PATH', 'translations'),
/*
|--------------------------------------------------------------------------
| Laravel Translations Custom Domain
|--------------------------------------------------------------------------
| You may change the domain where Laravel Translations should be active.
| If the domain is empty, all domains will be valid.
|
*/
'domain' => env('TRANSLATIONS_DOMAIN', null),
/*
|--------------------------------------------------------------------------
| Laravel Translations route middleware
|--------------------------------------------------------------------------
|
| These middleware will be assigned to every Laravel Translations route, giving you
| the chance to add your own middleware to this list or change any of
| the existing middleware. Or, you can simply stick with this list.
|
*/
'middleware' => ['web'],
/*
|--------------------------------------------------------------------------
| Database Connection
|--------------------------------------------------------------------------
|
| The database connection that should be used to store the imported
| translations You may specify the connection as a string
| which is the name of the connection in the database.php file
|
*/
'database_connection' => env('TRANSLATIONS_DB_CONNECTION', null),
];