From c075582cb0c8b555ac4caced7a84d5a561c8411c Mon Sep 17 00:00:00 2001 From: EL OUFIR Hatim Date: Thu, 15 Sep 2022 10:29:09 +0100 Subject: [PATCH 1/3] Create LICENSE.md --- LICENSE.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 LICENSE.md diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 00000000..92eddf73 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) shuvroroy + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. From 09a9d147171fe4de7ff5024a10bd72aeef281e1e Mon Sep 17 00:00:00 2001 From: EL OUFIR Hatim Date: Thu, 15 Sep 2022 10:43:32 +0100 Subject: [PATCH 2/3] Update README.md --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 8b007de4..449a1b1e 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,12 @@ # Help Desk +

+ Laravel v8.x + Livewire v2.x + Filament v2.x + PHP 8.0 +

+ Help Desk is a Laravel based project, that let you manage your support tickets and communicate with your customers, with a beautiful and simple to use platform. Help Desk is based on the latest version of Laravel and any other Open Source packages and technologies. From aadf12aa6a9ad99e6adfe83971c08f658721f1e7 Mon Sep 17 00:00:00 2001 From: EL OUFIR Hatim Date: Thu, 15 Sep 2022 15:49:32 +0100 Subject: [PATCH 3/3] Add french language --- .../Controllers/Auth/LogoutController.php | 2 +- app/Http/Kernel.php | 1 + app/Http/Livewire/Auth/Login.php | 1 + app/Http/Livewire/MyNotifications.php | 2 +- app/Http/Livewire/MyProfile.php | 14 +- app/Http/Middleware/LocaleMiddleware.php | 28 ++ app/Models/User.php | 1 + app/helpers.php | 16 ++ composer.json | 1 + composer.lock | 239 ++++++++++++------ .../laravel-translatable-string-exporter.php | 56 ++++ config/system.php | 13 + .../2022_09_15_142643_add_local_to_user.php | 32 +++ lang/fr.json | 195 ++++++++++++++ 14 files changed, 515 insertions(+), 86 deletions(-) create mode 100644 app/Http/Middleware/LocaleMiddleware.php create mode 100644 config/laravel-translatable-string-exporter.php create mode 100644 database/migrations/2022_09_15_142643_add_local_to_user.php create mode 100644 lang/fr.json diff --git a/app/Http/Controllers/Auth/LogoutController.php b/app/Http/Controllers/Auth/LogoutController.php index a2a3c88b..7318b3ad 100644 --- a/app/Http/Controllers/Auth/LogoutController.php +++ b/app/Http/Controllers/Auth/LogoutController.php @@ -12,7 +12,7 @@ class LogoutController extends Controller public function __invoke(Request $request) { Auth::logout(); - $request->session()->invalidate(); + // $request->session()->invalidate(); $request->session()->regenerateToken(); return redirect('/'); } diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index 34b21c21..123d8d3a 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -64,5 +64,6 @@ class Kernel extends HttpKernel 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class, 'can_access_ticket' => \App\Http\Middleware\CanAccessTicket::class, + 'set_locale' => \App\Http\Middleware\LocaleMiddleware::class, ]; } diff --git a/app/Http/Livewire/Auth/Login.php b/app/Http/Livewire/Auth/Login.php index 7ce6c4b3..13df67b3 100644 --- a/app/Http/Livewire/Auth/Login.php +++ b/app/Http/Livewire/Auth/Login.php @@ -95,6 +95,7 @@ public function login(): void ]); } + session()->put('locale', auth()->user()->locale); redirect()->to(route('home')); } diff --git a/app/Http/Livewire/MyNotifications.php b/app/Http/Livewire/MyNotifications.php index de998945..a14a8208 100644 --- a/app/Http/Livewire/MyNotifications.php +++ b/app/Http/Livewire/MyNotifications.php @@ -43,7 +43,7 @@ public function markAllRead(): void Notification::make() ->success() ->title(__('Notifications updated')) - ->body(__('All unread notifications is not marked as read')) + ->body(__('All unread notifications is marked as read')) ->send(); } } diff --git a/app/Http/Livewire/MyProfile.php b/app/Http/Livewire/MyProfile.php index 64a40f43..44449287 100644 --- a/app/Http/Livewire/MyProfile.php +++ b/app/Http/Livewire/MyProfile.php @@ -4,6 +4,7 @@ use App\Models\User; use Filament\Forms\Components\Grid; +use Filament\Forms\Components\Radio; use Filament\Forms\Components\Select; use Filament\Forms\Components\TextInput; use Filament\Forms\Concerns\InteractsWithForms; @@ -42,7 +43,8 @@ private function initProfile(): void $this->user = User::where('id', auth()->user()->id)->first(); $this->form->fill([ 'name' => $this->user->name, - 'email' => $this->user->email + 'email' => $this->user->email, + 'locale' => $this->user->locale, ]); if (session()->has('profile_updated')) { Notification::make() @@ -86,6 +88,14 @@ protected function getFormSchema(): array ->label(__('Password confirmation')) ->dehydrated(false), ]), + + Grid::make(1) + ->schema([ + Radio::make('locale') + ->label(__('Default language')) + ->options(locales()) + ->required() + ]), ]; } @@ -95,10 +105,12 @@ public function save(): void if (Hash::check($data['current_password'], $this->user->password)) { $this->user->name = $data['name']; $this->user->email = $data['email']; + $this->user->locale = $data['locale']; if ($data['new_password']) { $this->user->password = bcrypt($data['new_password']); } $this->user->save(); + session()->put('locale', $this->user->locale); session()->flash('profile_updated', true); redirect()->to(route('my-profile')); } else { diff --git a/app/Http/Middleware/LocaleMiddleware.php b/app/Http/Middleware/LocaleMiddleware.php new file mode 100644 index 00000000..b9e653f6 --- /dev/null +++ b/app/Http/Middleware/LocaleMiddleware.php @@ -0,0 +1,28 @@ +has('locale') && in_array(session()->get('locale'), array_keys(config('system.locales')))) { + $locale = session()->get('locale'); + } else if (auth()->user()?->locale && in_array(auth()->user()?->locale, array_keys(config('system.locales')))) { + $locale = auth()->user()?->locale; + } + app()->setLocale($locale); + return $next($request); + } +} diff --git a/app/Models/User.php b/app/Models/User.php index 1efd4fb4..076de638 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -29,6 +29,7 @@ class User extends Authenticatable 'password', 'role', 'register_token', + 'locale', ]; /** diff --git a/app/helpers.php b/app/helpers.php index ed160e31..493b08e1 100644 --- a/app/helpers.php +++ b/app/helpers.php @@ -147,3 +147,19 @@ function types_list(): array return $priorities; } } + +if (!function_exists('locales')) { + /** + * Return application locales as an array of KEY (locale id) => VALUE (locale title) + * + * @return array + */ + function locales(): array + { + $roles = []; + foreach (config('system.locales') as $key => $value) { + $roles[$key] = __($value); + } + return $roles; + } +} diff --git a/composer.json b/composer.json index de695e24..a926d7d2 100644 --- a/composer.json +++ b/composer.json @@ -17,6 +17,7 @@ }, "require-dev": { "fakerphp/faker": "^1.9.1", + "kkomelin/laravel-translatable-string-exporter": "^1.17", "laravel/pint": "^1.0", "laravel/sail": "^1.0.1", "mockery/mockery": "^1.4.4", diff --git a/composer.lock b/composer.lock index 12071305..58d6054a 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "6d1270718309a2b22370dd744228a882", + "content-hash": "ce59978fb4fd9bcad9576151196a79e0", "packages": [ { "name": "akaunting/laravel-money", @@ -758,16 +758,16 @@ }, { "name": "filament/filament", - "version": "v2.16.1", + "version": "v2.16.2", "source": { "type": "git", "url": "https://github.com/filamentphp/admin.git", - "reference": "4bfea272b3a4210fff0f3440a03072f7daa3568f" + "reference": "91a73f1a583a964ed7c657f5d8627b6eb10d7903" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/admin/zipball/4bfea272b3a4210fff0f3440a03072f7daa3568f", - "reference": "4bfea272b3a4210fff0f3440a03072f7daa3568f", + "url": "https://api.github.com/repos/filamentphp/admin/zipball/91a73f1a583a964ed7c657f5d8627b6eb10d7903", + "reference": "91a73f1a583a964ed7c657f5d8627b6eb10d7903", "shasum": "" }, "require": { @@ -817,20 +817,20 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2022-09-10T14:22:14+00:00" + "time": "2022-09-12T15:57:50+00:00" }, { "name": "filament/forms", - "version": "v2.16.1", + "version": "v2.16.2", "source": { "type": "git", "url": "https://github.com/filamentphp/forms.git", - "reference": "24412c86e593871aab5442caed63f2b72b1494a7" + "reference": "0de49bf91025c25df22ee596f2df624a4a7a5039" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/forms/zipball/24412c86e593871aab5442caed63f2b72b1494a7", - "reference": "24412c86e593871aab5442caed63f2b72b1494a7", + "url": "https://api.github.com/repos/filamentphp/forms/zipball/0de49bf91025c25df22ee596f2df624a4a7a5039", + "reference": "0de49bf91025c25df22ee596f2df624a4a7a5039", "shasum": "" }, "require": { @@ -875,20 +875,20 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2022-09-10T12:35:15+00:00" + "time": "2022-09-12T15:57:51+00:00" }, { "name": "filament/notifications", - "version": "v2.16.1", + "version": "v2.16.2", "source": { "type": "git", "url": "https://github.com/filamentphp/notifications.git", - "reference": "7c82359cc3521892aa5ab47e50ef9670a1a2f240" + "reference": "3c704738306123337acebe0ba990c6fd84b4842c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/notifications/zipball/7c82359cc3521892aa5ab47e50ef9670a1a2f240", - "reference": "7c82359cc3521892aa5ab47e50ef9670a1a2f240", + "url": "https://api.github.com/repos/filamentphp/notifications/zipball/3c704738306123337acebe0ba990c6fd84b4842c", + "reference": "3c704738306123337acebe0ba990c6fd84b4842c", "shasum": "" }, "require": { @@ -925,20 +925,20 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2022-09-10T14:22:10+00:00" + "time": "2022-09-12T15:57:43+00:00" }, { "name": "filament/support", - "version": "v2.16.1", + "version": "v2.16.2", "source": { "type": "git", "url": "https://github.com/filamentphp/support.git", - "reference": "274f6d3873bf57d20d6183e72cbab35e0d24cab6" + "reference": "65d67c72ab370ba193d203f09975a033f627de09" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/support/zipball/274f6d3873bf57d20d6183e72cbab35e0d24cab6", - "reference": "274f6d3873bf57d20d6183e72cbab35e0d24cab6", + "url": "https://api.github.com/repos/filamentphp/support/zipball/65d67c72ab370ba193d203f09975a033f627de09", + "reference": "65d67c72ab370ba193d203f09975a033f627de09", "shasum": "" }, "require": { @@ -975,20 +975,20 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2022-09-10T12:35:22+00:00" + "time": "2022-09-12T15:57:43+00:00" }, { "name": "filament/tables", - "version": "v2.16.1", + "version": "v2.16.2", "source": { "type": "git", "url": "https://github.com/filamentphp/tables.git", - "reference": "fba9cefe2a63dbf53879d708c7c974b141c203b1" + "reference": "b5854e190dd8ba9c463b6c5a8c26e70978e28e73" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/tables/zipball/fba9cefe2a63dbf53879d708c7c974b141c203b1", - "reference": "fba9cefe2a63dbf53879d708c7c974b141c203b1", + "url": "https://api.github.com/repos/filamentphp/tables/zipball/b5854e190dd8ba9c463b6c5a8c26e70978e28e73", + "reference": "b5854e190dd8ba9c463b6c5a8c26e70978e28e73", "shasum": "" }, "require": { @@ -1031,7 +1031,7 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2022-09-10T12:35:17+00:00" + "time": "2022-09-12T15:57:42+00:00" }, { "name": "fruitcake/php-cors", @@ -1499,16 +1499,16 @@ }, { "name": "laravel/framework", - "version": "v9.29.0", + "version": "v9.30.1", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "585da0913e907fd54941260860ae3d7d4be8e8cb" + "reference": "9533f7926f31939f25a620fbbf545318c18c943f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/585da0913e907fd54941260860ae3d7d4be8e8cb", - "reference": "585da0913e907fd54941260860ae3d7d4be8e8cb", + "url": "https://api.github.com/repos/laravel/framework/zipball/9533f7926f31939f25a620fbbf545318c18c943f", + "reference": "9533f7926f31939f25a620fbbf545318c18c943f", "shasum": "" }, "require": { @@ -1585,12 +1585,15 @@ "illuminate/view": "self.version" }, "require-dev": { + "ably/ably-php": "^1.0", "aws/aws-sdk-php": "^3.198.1", "doctrine/dbal": "^2.13.3|^3.1.4", "fakerphp/faker": "^1.9.2", "guzzlehttp/guzzle": "^7.2", "league/flysystem-aws-s3-v3": "^3.0", "league/flysystem-ftp": "^3.0", + "league/flysystem-path-prefixing": "^3.3", + "league/flysystem-read-only": "^3.3", "league/flysystem-sftp-v3": "^3.0", "mockery/mockery": "^1.4.4", "orchestra/testbench-core": "^7.1", @@ -1598,7 +1601,8 @@ "phpstan/phpstan": "^1.4.7", "phpunit/phpunit": "^9.5.8", "predis/predis": "^1.1.9|^2.0", - "symfony/cache": "^6.0" + "symfony/cache": "^6.0", + "symfony/uid": "^6.0" }, "suggest": { "ably/ably-php": "Required to use the Ably broadcast driver (^1.0).", @@ -1618,6 +1622,8 @@ "laravel/tinker": "Required to use the tinker console command (^2.0).", "league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (^3.0).", "league/flysystem-ftp": "Required to use the Flysystem FTP driver (^3.0).", + "league/flysystem-path-prefixing": "Required to use the scoped driver (^3.3).", + "league/flysystem-read-only": "Required to use read-only disks (^3.3)", "league/flysystem-sftp-v3": "Required to use the Flysystem SFTP driver (^3.0).", "mockery/mockery": "Required to use mocking (^1.4.4).", "nyholm/psr7": "Required to use PSR-7 bridging features (^1.2).", @@ -1631,7 +1637,8 @@ "symfony/http-client": "Required to enable support for the Symfony API mail transports (^6.0).", "symfony/mailgun-mailer": "Required to enable support for the Mailgun mail transport (^6.0).", "symfony/postmark-mailer": "Required to enable support for the Postmark mail transport (^6.0).", - "symfony/psr-http-message-bridge": "Required to use PSR-7 bridging features (^2.0)." + "symfony/psr-http-message-bridge": "Required to use PSR-7 bridging features (^2.0).", + "symfony/uid": "Required to generate ULIDs for Eloquent (^6.0)." }, "type": "library", "extra": { @@ -1675,7 +1682,7 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2022-09-09T18:21:21+00:00" + "time": "2022-09-15T13:15:47+00:00" }, { "name": "laravel/sanctum", @@ -2684,20 +2691,20 @@ }, { "name": "nette/utils", - "version": "v3.2.7", + "version": "v3.2.8", "source": { "type": "git", "url": "https://github.com/nette/utils.git", - "reference": "0af4e3de4df9f1543534beab255ccf459e7a2c99" + "reference": "02a54c4c872b99e4ec05c4aec54b5a06eb0f6368" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nette/utils/zipball/0af4e3de4df9f1543534beab255ccf459e7a2c99", - "reference": "0af4e3de4df9f1543534beab255ccf459e7a2c99", + "url": "https://api.github.com/repos/nette/utils/zipball/02a54c4c872b99e4ec05c4aec54b5a06eb0f6368", + "reference": "02a54c4c872b99e4ec05c4aec54b5a06eb0f6368", "shasum": "" }, "require": { - "php": ">=7.2 <8.2" + "php": ">=7.2 <8.3" }, "conflict": { "nette/di": "<3.0.6" @@ -2763,9 +2770,9 @@ ], "support": { "issues": "https://github.com/nette/utils/issues", - "source": "https://github.com/nette/utils/tree/v3.2.7" + "source": "https://github.com/nette/utils/tree/v3.2.8" }, - "time": "2022-01-24T11:29:14+00:00" + "time": "2022-09-12T23:36:20+00:00" }, { "name": "nikic/php-parser", @@ -3615,20 +3622,20 @@ }, { "name": "ramsey/uuid", - "version": "4.4.0", + "version": "4.5.0", "source": { "type": "git", "url": "https://github.com/ramsey/uuid.git", - "reference": "373f7bacfcf3de038778ff27dcce5672ddbf4c8a" + "reference": "ef842484ba57f163c6d465ab744bfecb872a11d4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ramsey/uuid/zipball/373f7bacfcf3de038778ff27dcce5672ddbf4c8a", - "reference": "373f7bacfcf3de038778ff27dcce5672ddbf4c8a", + "url": "https://api.github.com/repos/ramsey/uuid/zipball/ef842484ba57f163c6d465ab744bfecb872a11d4", + "reference": "ef842484ba57f163c6d465ab744bfecb872a11d4", "shasum": "" }, "require": { - "brick/math": "^0.8 || ^0.9 || ^0.10", + "brick/math": "^0.8.8 || ^0.9 || ^0.10", "ext-ctype": "*", "ext-json": "*", "php": "^8.0", @@ -3649,12 +3656,13 @@ "php-mock/php-mock-mockery": "^1.3", "php-parallel-lint/php-parallel-lint": "^1.1", "phpbench/phpbench": "^1.0", - "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^0.12", - "phpstan/phpstan-mockery": "^0.12", - "phpstan/phpstan-phpunit": "^0.12", + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan": "^1.8", + "phpstan/phpstan-mockery": "^1.1", + "phpstan/phpstan-phpunit": "^1.1", "phpunit/phpunit": "^8.5 || ^9", - "slevomat/coding-standard": "^7.0", + "ramsey/composer-repl": "^1.4", + "slevomat/coding-standard": "^8.4", "squizlabs/php_codesniffer": "^3.5", "vimeo/psalm": "^4.9" }, @@ -3692,7 +3700,7 @@ ], "support": { "issues": "https://github.com/ramsey/uuid/issues", - "source": "https://github.com/ramsey/uuid/tree/4.4.0" + "source": "https://github.com/ramsey/uuid/tree/4.5.0" }, "funding": [ { @@ -3704,7 +3712,7 @@ "type": "tidelift" } ], - "time": "2022-08-05T17:58:37+00:00" + "time": "2022-09-15T01:44:53+00:00" }, { "name": "ryangjchandler/blade-capture-directive", @@ -6064,16 +6072,16 @@ }, { "name": "tijsverkoyen/css-to-inline-styles", - "version": "2.2.4", + "version": "2.2.5", "source": { "type": "git", "url": "https://github.com/tijsverkoyen/CssToInlineStyles.git", - "reference": "da444caae6aca7a19c0c140f68c6182e337d5b1c" + "reference": "4348a3a06651827a27d989ad1d13efec6bb49b19" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/tijsverkoyen/CssToInlineStyles/zipball/da444caae6aca7a19c0c140f68c6182e337d5b1c", - "reference": "da444caae6aca7a19c0c140f68c6182e337d5b1c", + "url": "https://api.github.com/repos/tijsverkoyen/CssToInlineStyles/zipball/4348a3a06651827a27d989ad1d13efec6bb49b19", + "reference": "4348a3a06651827a27d989ad1d13efec6bb49b19", "shasum": "" }, "require": { @@ -6111,9 +6119,9 @@ "homepage": "https://github.com/tijsverkoyen/CssToInlineStyles", "support": { "issues": "https://github.com/tijsverkoyen/CssToInlineStyles/issues", - "source": "https://github.com/tijsverkoyen/CssToInlineStyles/tree/2.2.4" + "source": "https://github.com/tijsverkoyen/CssToInlineStyles/tree/2.2.5" }, - "time": "2021-12-08T09:12:39+00:00" + "time": "2022-09-12T13:28:28+00:00" }, { "name": "vlucas/phpdotenv", @@ -6588,18 +6596,83 @@ }, "time": "2020-07-09T08:09:16+00:00" }, + { + "name": "kkomelin/laravel-translatable-string-exporter", + "version": "1.17.0", + "source": { + "type": "git", + "url": "https://github.com/kkomelin/laravel-translatable-string-exporter.git", + "reference": "0425f2c3add32df852c002b11bffe72c9c67ec89" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/kkomelin/laravel-translatable-string-exporter/zipball/0425f2c3add32df852c002b11bffe72c9c67ec89", + "reference": "0425f2c3add32df852c002b11bffe72c9c67ec89", + "shasum": "" + }, + "require": { + "ext-json": "*", + "illuminate/support": "^5.4|^6|^7|^8|^9", + "illuminate/translation": "^5.4|^6|^7|^8|^9", + "php": "^7.2|^8.0", + "symfony/finder": "^3.2|^4|^5|^6" + }, + "require-dev": { + "nunomaduro/larastan": "^1.0|^2.0", + "orchestra/testbench": "^3.4|^4.0|^5.0|^6.0|^7.0", + "phpunit/phpunit": "^6.0|^7.0|^8.0|^9.0" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "KKomelin\\TranslatableStringExporter\\Providers\\ExporterServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "KKomelin\\TranslatableStringExporter\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Komelin", + "email": "konstantin.komelin@gmail.com" + } + ], + "description": "Translatable String Exporter for Laravel", + "keywords": [ + "export", + "exporter", + "json", + "laravel", + "localization", + "translation", + "translations" + ], + "support": { + "issues": "https://github.com/kkomelin/laravel-translatable-string-exporter/issues", + "source": "https://github.com/kkomelin/laravel-translatable-string-exporter/tree/1.17.0" + }, + "time": "2022-06-13T07:13:55+00:00" + }, { "name": "laravel/pint", - "version": "v1.1.3", + "version": "v1.2.0", "source": { "type": "git", "url": "https://github.com/laravel/pint.git", - "reference": "9fb8e93074de3c04a0975beb90dcb38562afbdaa" + "reference": "1d276e4c803397a26cc337df908f55c2a4e90d86" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/pint/zipball/9fb8e93074de3c04a0975beb90dcb38562afbdaa", - "reference": "9fb8e93074de3c04a0975beb90dcb38562afbdaa", + "url": "https://api.github.com/repos/laravel/pint/zipball/1d276e4c803397a26cc337df908f55c2a4e90d86", + "reference": "1d276e4c803397a26cc337df908f55c2a4e90d86", "shasum": "" }, "require": { @@ -6652,7 +6725,7 @@ "issues": "https://github.com/laravel/pint/issues", "source": "https://github.com/laravel/pint" }, - "time": "2022-09-06T16:01:44+00:00" + "time": "2022-09-13T15:07:15+00:00" }, { "name": "laravel/sail", @@ -7629,16 +7702,16 @@ }, { "name": "sebastian/comparator", - "version": "4.0.6", + "version": "4.0.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "55f4261989e546dc112258c7a75935a81a7ce382" + "reference": "fa0f136dd2334583309d32b62544682ee972b51a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/55f4261989e546dc112258c7a75935a81a7ce382", - "reference": "55f4261989e546dc112258c7a75935a81a7ce382", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa0f136dd2334583309d32b62544682ee972b51a", + "reference": "fa0f136dd2334583309d32b62544682ee972b51a", "shasum": "" }, "require": { @@ -7691,7 +7764,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.6" + "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8" }, "funding": [ { @@ -7699,7 +7772,7 @@ "type": "github" } ], - "time": "2020-10-26T15:49:45+00:00" + "time": "2022-09-14T12:41:17+00:00" }, { "name": "sebastian/complexity", @@ -7889,16 +7962,16 @@ }, { "name": "sebastian/exporter", - "version": "4.0.4", + "version": "4.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9" + "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/65e8b7db476c5dd267e65eea9cab77584d3cfff9", - "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", + "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", "shasum": "" }, "require": { @@ -7954,7 +8027,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.4" + "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.5" }, "funding": [ { @@ -7962,7 +8035,7 @@ "type": "github" } ], - "time": "2021-11-11T14:18:36+00:00" + "time": "2022-09-14T06:03:37+00:00" }, { "name": "sebastian/global-state", @@ -8317,16 +8390,16 @@ }, { "name": "sebastian/type", - "version": "3.1.0", + "version": "3.2.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/type.git", - "reference": "fb44e1cc6e557418387ad815780360057e40753e" + "reference": "fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/fb44e1cc6e557418387ad815780360057e40753e", - "reference": "fb44e1cc6e557418387ad815780360057e40753e", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e", + "reference": "fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e", "shasum": "" }, "require": { @@ -8338,7 +8411,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-master": "3.2-dev" } }, "autoload": { @@ -8361,7 +8434,7 @@ "homepage": "https://github.com/sebastianbergmann/type", "support": { "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/3.1.0" + "source": "https://github.com/sebastianbergmann/type/tree/3.2.0" }, "funding": [ { @@ -8369,7 +8442,7 @@ "type": "github" } ], - "time": "2022-08-29T06:55:37+00:00" + "time": "2022-09-12T14:47:03+00:00" }, { "name": "sebastian/version", @@ -8780,5 +8853,5 @@ "php": "^8.0.2" }, "platform-dev": [], - "plugin-api-version": "2.2.0" + "plugin-api-version": "2.1.0" } diff --git a/config/laravel-translatable-string-exporter.php b/config/laravel-translatable-string-exporter.php new file mode 100644 index 00000000..e9433c7e --- /dev/null +++ b/config/laravel-translatable-string-exporter.php @@ -0,0 +1,56 @@ + [ + 'app', + 'resources', + ], + + // Directories to exclude from search. + // + // Please note, these directories should be relative to the ones listed in 'directories'. + // For example, if you have 'resources' in 'directories', then to ignore the 'resources/ignored' directory, + // you need to add 'ignored' to the 'excluded-directories' list. + 'excluded-directories'=> [ + ], + + // File Patterns to search for. + 'patterns'=> [ + '*.php', + '*.js', + ], + + // Indicates whether new lines are allowed in translations. + 'allow-newlines' => false, + + // Translation function names. + // If your function name contains $ escape it using \$ . + 'functions'=> [ + '__', + '_t', + '@lang', + ], + + // Indicates whether you need to sort the translations alphabetically + // by original strings (keys). + // It helps navigate a translation file and detect possible duplicates. + 'sort-keys' => true, + + // Indicates whether keys from the persistent-strings file should be also added + // to translation files automatically on export if they don't yet exist there. + 'add-persistent-strings-to-translations' => false, + + // Indicates whether it's necessary to exclude Laravel translation keys + // from the resulting language file if they have corresponding translations + // in the given language. + // This option allows correctly combine two translation approaches: + // Laravel translation keys (PHP) and translatable strings (JSON). + 'exclude-translation-keys' => false, + + // Indicates whether you need to put untranslated strings + // at the top of a translation file. + // The criterion of whether a string is untranslated is + // if its key and value are equivalent. + // If sorting is enabled, untranslated and translated strings are sorted separately. + 'put-untranslated-strings-at-the-top' => false, +]; diff --git a/config/system.php b/config/system.php index 49bf51f0..52cd8df9 100644 --- a/config/system.php +++ b/config/system.php @@ -2,6 +2,19 @@ return [ + /* + |-------------------------------------------------------------------------- + | Locales configuration + |-------------------------------------------------------------------------- + | + | This value is the configured locales that the application can use + | + */ + 'locales' => [ + 'en' => 'English', + 'fr' => 'Français' + ], + /* |-------------------------------------------------------------------------- | Statuses configuration diff --git a/database/migrations/2022_09_15_142643_add_local_to_user.php b/database/migrations/2022_09_15_142643_add_local_to_user.php new file mode 100644 index 00000000..7b041158 --- /dev/null +++ b/database/migrations/2022_09_15_142643_add_local_to_user.php @@ -0,0 +1,32 @@ +string('locale')->default('en'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('users', function (Blueprint $table) { + $table->dropColumn('locale'); + }); + } +}; diff --git a/lang/fr.json b/lang/fr.json new file mode 100644 index 00000000..e5b5a69b --- /dev/null +++ b/lang/fr.json @@ -0,0 +1,195 @@ +{ + "- Content: :content": "- Contenu : :content", + "- Field: :field": "- Champ : :field", + "- New value: :newValue": "- Nouvelle valeur : :newValue", + "- Old value: :oldValue": "- Ancienne valeur : :oldValue", + "- Owner: :owner": "- Propriétaire : :owner", + "- Priority: :priority": "- Priorité : :priority", + "- Title: :title": "- Titre : :title", + "- Type: :type": "- Type : :type", + ":user commented the ticket :ticket": ":user a commenté le ticket :ticket", + ":user created the ticket :ticket": ":user a créé le ticket :ticket", + ":user updated the ticket :ticket": ":user a mis à jour le ticket :ticket", + "A password recovery email has been sent": "Un e-mail de récupération de mot de passe a été envoyé", + "Account activated": "Compte activé", + "Account created:": "Comte créé :", + "Actions": "Actions", + "Activate": "Activer", + "Activate account": "Activer le compte", + "Activate my account": "Activer mon compte", + "Add comment": "Ajouter un commentaire", + "Added a comment": "A ajouté un commentaire", + "After:": "Après :", + "All tickets are assigned!": "Tous les tickets sont attribués !", + "All unread notifications is marked as read": "Toutes les notifications non lues sont marquées comme lues", + "An email has been sent to the user": "Un e-mail a été envoyé à l'utilisateur", + "Analytics": "Analytique", + "Are you sure you want to delete this comment?": "Êtes-vous sûr de vouloir supprimer ce commentaire ?", + "Are you sure you want to delete this project?": "Voulez-vous vraiment supprimer ce projet ?", + "Are you sure you want to delete this user?": "Êtes-vous sûr de vouloir supprimer cet utilisateur ?", + "Assign to me": "Me l'assigner", + "Assigned tickets": "Tickets assignés", + "Back to sign in page": "Retour à la page de connexion", + "Before:": "Avant :", + "Below are the details of this comment:": "Ci-dessous les détails de ce commentaire :", + "Below are the details of this modification:": "Voici les détails de cette modification :", + "Below are the details of this ticket:": "Ci-dessous les détails de ce ticket :", + "Below is the dashboard containing all analytics related to projects and tickets configured in :app": "Vous trouverez ci-dessous le tableau de bord contenant toutes les analyses liées aux projets et aux tickets configurés dans :app", + "Below is the list of configured projects in :app": "Ci-dessous la liste des projets configurés dans :app", + "Below is the list of configured users having access to :app": "Ci-dessous la liste des utilisateurs configurés ayant accès à :app", + "Below is the list of created tickets in :app": "Ci-dessous la liste des tickets créés dans :app", + "Below is the list of notifications you have received on :app": "Ci-dessous la liste des notifications que vous avez reçues sur :app", + "Cancel": "Annuler", + "Choose a new password to your account and click submit button to confirm": "Choisissez un nouveau mot de passe pour votre compte et cliquez sur le bouton soumettre pour confirmer", + "Choose a password": "Choisissez un mot de passe", + "Choose a password and confirm it then click the activate button to access your account": "Choisissez un mot de passe et confirmez-le puis cliquez sur le bouton activer pour accéder à votre compte", + "Click here to recover it": "Cliquez ici pour le récupérer", + "Comment created": "Commentaire créé", + "Comment deleted": "Commentaire supprimé", + "Comment deletion": "Suppression de commentaire", + "Comment updated": "Commentaire mis à jour", + "Confirm": "Confirmer", + "Confirm your password": "Confirmez votre mot de passe", + "Content": "Contenu", + "Content updated": "Contenu mis à jour", + "Create a new project": "Créer un nouveau projet", + "Create a new ticket": "Créer un nouveau ticket", + "Create a new user": "Créer un nouvel utilisateur", + "Created at": "Créé le", + "Created:": "Créé :", + "Current password": "Mot de passe actuel", + "Delete": "Supprimer", + "Description": "Description", + "Did you forget your password?": "Avez-vous oublié votre mot de passe ?", + "Edit": "Modifier", + "Edit project": "Modifier le projet", + "Edit user": "Modifier l'utilisateur", + "Email address": "Adresse email", + "Favorite added": "Favoris ajouté", + "Favorite projects": "Projets favoris", + "Favorite removed": "Favoris supprimé", + "Field:": "Champ :", + "Filters": "Filtres", + "Forgot password?": "Mot de passe oublié ?", + "Full name": "Nom complet", + "Go back to tickets list": "Revenir à la liste des tickets", + "Go to page :page": "Aller à la page :page", + "Go to sign in page": "Aller à la page de connexion", + "Have you already activated your user account?": "Avez-vous déjà activé votre compte utilisateur ?", + "Hello again !": "Bienvenu !", + "Last update:": "Dernière mise à jour :", + "Mark all unread notification as read": "Marquer toutes les notifications comme lues", + "Mark as read": "Marquer comme lu", + "My assigned tickets": "Mes tickets assignés", + "My profile": "Mon profil", + "New password": "Nouveau mot de passe", + "No assigned tickets yet!": "Aucun ticket assigné !", + "No comments yet!": "Aucun commentaire pour le moment !", + "No notifications received yet!": "Aucune notifications reçues pour le moment !", + "No projects to show!": "Aucun projet à afficher !", + "No tickets assigned!": "Aucun ticket assigné !", + "No tickets configured!": "Aucun ticket configuré !", + "No tickets to show!": "Aucun ticket à afficher !", + "No worries": "Pas de soucis", + "No worries! Just type your email and click submit button and you will receive a recovery link by email": "Pas de soucis! Tapez simplement votre e-mail et cliquez sur le bouton Soumettre et vous recevrez un lien de récupération par e-mail.", + "Not assigned tickets": "Aucun ticket assigné", + "Not assigned yet!": "Non assigné !", + "Notification updated": "Notification mise à jour", + "Notifications": "Notifications", + "Notifications updated": "Notifications mises à jour", + "of": "des", + "Owner": "Propriétaire", + "Pagination Navigation": "Pagination", + "pagination.next": "pagination.suivant", + "pagination.previous": "pagination.précédent", + "Password": "Mot de passe", + "Password confirmation": "Confirmation du mot de passe", + "Priorities": "Priorités", + "Priority": "Priorité", + "Priority updated": "Priorité mise à jour", + "Profile updated": "Profil mis à jour", + "Project": "Projet", + "Project created": "Projet créé", + "Project deleted": "Projet supprimé", + "Project deletion": "Suppression du projet", + "Project name": "Nom du projet", + "Project updated": "Projet mis à jour", + "Projects": "Projets", + "Received at": "Reçu le", + "Recover password": "Récupération du mot de passe", + "Remember me": "Se souvenir de moi", + "Resend activation email": "Renvoyer l'email d'activation", + "Responsible": "Responsable", + "Responsible updated": "Responsable mis à jour", + "results": "Résultats", + "Role": "Rôle", + "Save": "Sauvegarder", + "Search for projects": "Rechercher les projets", + "Search for tickets": "Rechercher les tickets", + "Search for users": "Rechercher les utilisateurs", + "Showing": "Affichage", + "Sign in": "Connexion", + "Sign out": "Déconnexion", + "Status": "Statut", + "Status updated": "Statut mis à jour", + "Statuses": "Statuts", + "Submit": "Soumettre", + "Success": "Succès", + "Thank you for using our application!": "Merci d'utiliser notre application!", + "The comment has been deleted": "Le commentaire a été supprimé", + "The comment has been updated": "Le commentaire a été mis à jour", + "The notification is now marked as read": "La notification est maintenant marquée comme lue", + "The password entered is incorrect.": "Le mot de passe saisi est incorrect.", + "The project has been deleted": "Le projet a été supprimé", + "The project has been successfully added to your favorite projects": "Le projet a été ajouté avec succès à vos projets favoris", + "The project has been successfully created": "Le projet a été créé avec succès", + "The project has been successfully remove from your favorite projects": "Le projet a été supprimé avec succès de vos projets favoris", + "The project's details has been updated": "Les détails du projet ont été mis à jour", + "The ticket content has been successfully updated": "Le contenu du ticket a été mis à jour avec succès", + "The ticket has been successfully created": "Le ticket a été créé avec succès", + "The ticket priority has been successfully updated": "La priorité du ticket a été mise à jour avec succès", + "The ticket responsible has been successfully updated": "Le responsable du ticket a été mis à jour avec succès", + "The ticket status has been successfully updated": "Le statut du ticket a été mis à jour avec succès", + "The ticket title has been successfully updated": "Le titre du ticket a été mis à jour avec succès", + "The ticket type has been successfully updated": "Le type de ticket a été mis à jour avec succès", + "The user has been deleted": "L'utilisateur a été supprimé", + "The user's details has been updated": "Les détails de l'utilisateur ont été mis à jour", + "These credentials do not match our records.": "Ces informations d'identification ne correspondent pas à nos dossiers.", + "Ticket created": "Ticket créé", + "Ticket details": "Détails du ticket", + "Ticket title": "Titre du ticket", + "Tickets": "Tickets", + "Tickets assignments": "Affectations de tickets", + "Tickets by statuses": "Tickets par statuts", + "Title": "Titre", + "Title updated": "Titre mis à jour", + "Too many login attempts. Please try again in :seconds seconds.": "Trop de tentatives de connexion. Veuillez réessayer dans : secondes secondes.", + "Type": "Taper", + "Type a new comment...": "Tapez un nouveau commentaire...", + "Type updated": "Type mis à jour", + "Types": "Les types", + "Unassigned": "Non attribué", + "Update": "Mise à jour", + "Update your :app user account by using the below form.": "Mettez à jour votre compte utilisateur :app en utilisant le formulaire ci-dessous.", + "Update your comment...": "Mettez à jour votre commentaire...", + "User created": "Utilisateur créé", + "User deleted": "Utilisateur supprimé", + "User deletion": "Suppression d'utilisateur", + "User updated": "Utilisateur mis à jour", + "Users": "Utilisateurs", + "View ticket details": "Afficher les détails du ticket", + "View tickets": "Voir les tickets", + "We are pleased to inform you that your user account on the :platform platform has been successfully created.": "Nous avons le plaisir de vous informer que votre compte utilisateur sur la plateforme :platform a été créé avec succès.", + "We inform you that a new comment has been added to the ticket :ticket in the platform :platform.": "Nous vous informons qu'un nouveau commentaire a été ajouté au ticket :ticket dans la plateforme :platform.", + "We inform you that a new ticket has been created in the platform :platform.": "Nous vous informons qu'un nouveau ticket a été créé dans la plateforme :platform.", + "We inform you that the ticket :ticket has been updated.": "Nous vous informons que le ticket :ticket a été mis à jour.", + "We inform you that your user account for the :platform platform is now activated.": "Nous vous informons que votre compte utilisateur pour la plateforme :platform est désormais activé.", + "We invite you to use the following button to define your password and activate your user account.": "Nous vous invitons à utiliser le bouton suivant pour définir votre mot de passe et activer votre compte utilisateur.", + "Welcome again, fill the form below and click the sign in button to login into your account": "Bienvenue à nouveau, remplissez le formulaire ci-dessous et cliquez sur le bouton de connexion pour vous connecter à votre compte", + "Y-m-d g:i A": "d-m-Y H:i", + "You can use the following button to access the platform.": "Vous pouvez utiliser le bouton suivant pour accéder à la plateforme.", + "Your account details has been updated": "Les détails de votre compte ont été mis à jour", + "Your comment has been successfully added to the ticket": "Votre commentaire a bien été ajouté au ticket", + "Your password is now updated": "Votre mot de passe est maintenant à jour", + "Default language": "Langue par défaut" +}