From c7d87f9f558a96d6378cd823bbbf41036e3d1648 Mon Sep 17 00:00:00 2001 From: salam Date: Wed, 1 Oct 2025 19:44:00 +0200 Subject: [PATCH] translation wip --- app/Filament/Pages/Auth/Register.php | 58 +++++++++- .../Resources/Kontos/Schemas/KontoForm.php | 12 +- .../Resources/Kontos/Tables/KontosTable.php | 1 - composer.json | 4 +- composer.lock | 84 +++++++------- database/seeders/PlansSeeder.php | 2 +- lang/de/validation.php | 107 ++++++++++++++++++ 7 files changed, 210 insertions(+), 58 deletions(-) create mode 100644 lang/de/validation.php diff --git a/app/Filament/Pages/Auth/Register.php b/app/Filament/Pages/Auth/Register.php index 5901e82..1a93082 100644 --- a/app/Filament/Pages/Auth/Register.php +++ b/app/Filament/Pages/Auth/Register.php @@ -5,6 +5,7 @@ namespace App\Filament\Pages\Auth; use App\Models\Auftraggeber; use App\Models\Gutachter; use App\Models\Konto; +use App\Models\Plan; use Danielebarbaro\LaravelVatEuValidator\Rules\VatNumber; use Filament\Auth\Pages\Register as BaseRegister; use Filament\Forms\Components\Checkbox; @@ -17,9 +18,13 @@ use Filament\Schemas\Components\View; use Filament\Schemas\Components\Wizard; use Filament\Schemas\Components\Wizard\Step; use Filament\Schemas\Schema; +use Filament\Support\Enums\Alignment; +use Filament\Support\Enums\IconPosition; +use Filament\Support\Enums\IconSize; use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Facades\Blade; use Illuminate\Support\HtmlString; +use JaOcero\RadioDeck\Forms\Components\RadioDeck; use Ysfkaya\FilamentPhoneInput\Forms\PhoneInput; class Register extends BaseRegister @@ -40,10 +45,25 @@ class Register extends BaseRegister 'Frau' => 'Frau', 'Non-binary' => 'Non-binary', ]) - ->required(), - $this->getNameFormComponent(), - $this->getEmailFormComponent(), - $this->getPasswordFormComponent(), + ->required() + ->validationMessages([ + 'required' => 'Ein Geschlecht ist erforderlich.', + ]), + $this->getNameFormComponent()->validationMessages([ + 'required' => 'Ein Name ist erforderlich.', + ]), + $this->getEmailFormComponent() + ->validationMessages([ + 'required' => 'Eine E-Mail-Adresse ist erforderlich.', + ]), + $this->getPasswordFormComponent() + ->validationMessages([ + 'required' => 'Ein Passwort ist erforderlich.', + 'same' => 'Das Passwort muß mit dem "Passwort bestätigen" Feld übereinstimmen.', + 'min' => [ + 'string' => 'Das :attribute muß mindestens :min Stellen lang sein.', + ], + ]), $this->getPasswordConfirmationFormComponent(), ])->columnSpan(3), Wizard\Step::make('Konto') @@ -129,6 +149,33 @@ class Register extends BaseRegister ])->columnSpan(4), ]), + Wizard\Step::make('Zahlungsmodus') + ->icon('phosphor-coins') + ->visible(fn (Get $get): bool => $get('register-modus') == 'new') + ->description('Kann jederzeit geändert werden.') + ->schema([ + RadioDeck::make('plan_id') + ->label('Wählen sie eine Option') + ->options(fn () => Plan::pluck('name', 'id')->toArray()) + ->descriptions(Plan::options()) + ->icons(fn () => Plan::pluck('icon', 'id')->toArray()) + ->required() + ->default(1) + ->disabled() + ->iconPosition(IconPosition::Before) // Before | After + ->iconSize(IconSize::ExtraLarge) + ->alignment(Alignment::Center) // Start | Center | End + ->padding('p-2') // Padding around the deck + ->extraCardsAttributes([ + 'class' => 'rounded-xl drop-shadow-xl mt-1', + ]) + ->extraOptionsAttributes([ + 'class' => 'text-2xl font-black tracking-tight lg:text-3xl', + ]) + ->colors('primary') + ->columns(3) + ->columnSpanFull(), + ]), Wizard\Step::make('AGB') ->icon('lucide-receipt-text') ->description(' Allgemein Geschäftsbedignugen') @@ -136,8 +183,9 @@ class Register extends BaseRegister Fieldset::make('Bitte lesen und akzeptieren Sie die allgemeinen Geschäftsbedignungen um die Registrierung abzuschließen.') ->schema([ Checkbox::make('agb_akzeptiert') + ->default(false) ->label('ABG akzeptieren') - ->required(), + ->accepted(), ]), View::make('pages.agb'), diff --git a/app/Filament/Resources/Kontos/Schemas/KontoForm.php b/app/Filament/Resources/Kontos/Schemas/KontoForm.php index 0a4b633..796c708 100644 --- a/app/Filament/Resources/Kontos/Schemas/KontoForm.php +++ b/app/Filament/Resources/Kontos/Schemas/KontoForm.php @@ -30,7 +30,8 @@ class KontoForm Tab::make('Zahlungsplan') ->schema([ RadioDeck::make('plan_id') - ->label('Wählen sie eine Option') + // ->label('Wählen sie eine Option') + ->label('Zur Zeit bieten wie nur eine Zahlung per Gutachten an.') ->options(fn () => Plan::pluck('name', 'id')->toArray()) ->descriptions(Plan::options()) ->icons(fn () => Plan::pluck('icon', 'id')->toArray()) @@ -39,15 +40,12 @@ class KontoForm ->iconSize(IconSize::TwoExtraLarge) ->alignment(Alignment::Center) // Start | Center | End ->padding('px-4 py-6') // Padding around the deck - ->extraCardsAttributes([ // Extra attributes for card elements + ->extraCardsAttributes([ 'class' => 'rounded-xl drop-shadow-xl mt-1', ]) - ->extraOptionsAttributes([ // Extra attributes for option elements - 'class' => 'text-2xl md:text-3xl font-black tracking-tight lg:text-4xl', + ->extraOptionsAttributes([ + 'class' => 'text-2xl font-black tracking-tight lg:text-3xl', ]) - // ->extraDescriptionsAttributes([ // Extra attributes for description elements - // 'class' => 'text-sm font-light', - // ]) ->colors('primary') ->columns(3) ->columnSpanFull(), diff --git a/app/Filament/Resources/Kontos/Tables/KontosTable.php b/app/Filament/Resources/Kontos/Tables/KontosTable.php index b0e5ee9..5edaef4 100644 --- a/app/Filament/Resources/Kontos/Tables/KontosTable.php +++ b/app/Filament/Resources/Kontos/Tables/KontosTable.php @@ -28,7 +28,6 @@ class KontosTable ->color('primary') ->icon(fn (string $state): string => $state) ->extraAttributes(['class' => 'rounded-xl border border-gray-200 dark:border-gray-700 drop-shadow-xl']), - TextColumn::make('plan.name') ->label('Zahlungs Plan') ->description(fn ($record): string => $record->plan->payment), diff --git a/composer.json b/composer.json index 911c6e2..e4cbfb4 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ "bezhansalleh/filament-shield": "*", "codeat3/blade-phosphor-icons": "^2.3", "danielebarbaro/laravel-vat-eu-validator": "^2.0", - "filament/filament": "^4.0", + "filament/filament": "^4.1", "jaocero/radio-deck": "^2.0", "laravel/framework": "^12.0", "laravel/tinker": "^2.10.1", @@ -89,4 +89,4 @@ }, "minimum-stability": "stable", "prefer-stable": true -} +} \ No newline at end of file diff --git a/composer.lock b/composer.lock index 3a57e8d..ffc2f8f 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": "73c1ae2de1cd4105b50ac2d91b6220dd", + "content-hash": "bd1043a56ded4898f9fa116694f7c17e", "packages": [ { "name": "agencetwogether/hookshelper", @@ -2662,16 +2662,16 @@ }, { "name": "laravel/framework", - "version": "v12.32.1", + "version": "v12.32.5", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "d41e4ba47706ec85bda85fe9362515592871cd21" + "reference": "77b2740391cd2a825ba59d6fada45e9b8b9bcc5a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/d41e4ba47706ec85bda85fe9362515592871cd21", - "reference": "d41e4ba47706ec85bda85fe9362515592871cd21", + "url": "https://api.github.com/repos/laravel/framework/zipball/77b2740391cd2a825ba59d6fada45e9b8b9bcc5a", + "reference": "77b2740391cd2a825ba59d6fada45e9b8b9bcc5a", "shasum": "" }, "require": { @@ -2877,7 +2877,7 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2025-09-30T12:22:56+00:00" + "time": "2025-09-30T17:39:22+00:00" }, { "name": "laravel/prompts", @@ -3256,16 +3256,16 @@ }, { "name": "league/csv", - "version": "9.25.0", + "version": "9.26.0", "source": { "type": "git", "url": "https://github.com/thephpleague/csv.git", - "reference": "f856f532866369fb1debe4e7c5a1db185f40ef86" + "reference": "7fce732754d043f3938899e5183e2d0f3d31b571" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/csv/zipball/f856f532866369fb1debe4e7c5a1db185f40ef86", - "reference": "f856f532866369fb1debe4e7c5a1db185f40ef86", + "url": "https://api.github.com/repos/thephpleague/csv/zipball/7fce732754d043f3938899e5183e2d0f3d31b571", + "reference": "7fce732754d043f3938899e5183e2d0f3d31b571", "shasum": "" }, "require": { @@ -3343,7 +3343,7 @@ "type": "github" } ], - "time": "2025-09-11T08:29:08+00:00" + "time": "2025-10-01T11:24:54+00:00" }, { "name": "league/flysystem", @@ -9207,16 +9207,16 @@ "packages-dev": [ { "name": "brianium/paratest", - "version": "v7.12.0", + "version": "v7.14.0", "source": { "type": "git", "url": "https://github.com/paratestphp/paratest.git", - "reference": "6a34ddb12a3bd5bd07d831ce95f111087f3bcbd8" + "reference": "5dc47b3a4638a1c6c6b4941bee5908b2e2154b84" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paratestphp/paratest/zipball/6a34ddb12a3bd5bd07d831ce95f111087f3bcbd8", - "reference": "6a34ddb12a3bd5bd07d831ce95f111087f3bcbd8", + "url": "https://api.github.com/repos/paratestphp/paratest/zipball/5dc47b3a4638a1c6c6b4941bee5908b2e2154b84", + "reference": "5dc47b3a4638a1c6c6b4941bee5908b2e2154b84", "shasum": "" }, "require": { @@ -9227,24 +9227,24 @@ "fidry/cpu-core-counter": "^1.3.0", "jean85/pretty-package-versions": "^2.1.1", "php": "~8.3.0 || ~8.4.0 || ~8.5.0", - "phpunit/php-code-coverage": "^12.3.2", + "phpunit/php-code-coverage": "^12.4.0", "phpunit/php-file-iterator": "^6", "phpunit/php-timer": "^8", - "phpunit/phpunit": "^12.3.6", + "phpunit/phpunit": "^12.3.15", "sebastian/environment": "^8.0.3", - "symfony/console": "^6.4.20 || ^7.3.2", - "symfony/process": "^6.4.20 || ^7.3.0" + "symfony/console": "^6.4.20 || ^7.3.4", + "symfony/process": "^6.4.20 || ^7.3.4" }, "require-dev": { "doctrine/coding-standard": "^13.0.1", "ext-pcntl": "*", "ext-pcov": "*", "ext-posix": "*", - "phpstan/phpstan": "^2.1.22", + "phpstan/phpstan": "^2.1.29", "phpstan/phpstan-deprecation-rules": "^2.0.3", "phpstan/phpstan-phpunit": "^2.0.7", - "phpstan/phpstan-strict-rules": "^2.0.6", - "squizlabs/php_codesniffer": "^3.13.2", + "phpstan/phpstan-strict-rules": "^2.0.7", + "squizlabs/php_codesniffer": "^3.13.4", "symfony/filesystem": "^6.4.13 || ^7.3.2" }, "bin": [ @@ -9285,7 +9285,7 @@ ], "support": { "issues": "https://github.com/paratestphp/paratest/issues", - "source": "https://github.com/paratestphp/paratest/tree/v7.12.0" + "source": "https://github.com/paratestphp/paratest/tree/v7.14.0" }, "funding": [ { @@ -9297,7 +9297,7 @@ "type": "paypal" } ], - "time": "2025-08-29T05:28:31+00:00" + "time": "2025-09-30T08:03:23+00:00" }, { "name": "doctrine/deprecations", @@ -10105,20 +10105,20 @@ }, { "name": "pestphp/pest", - "version": "v4.1.0", + "version": "v4.1.1", "source": { "type": "git", "url": "https://github.com/pestphp/pest.git", - "reference": "b7406938ac9e8d08cf96f031922b0502a8523268" + "reference": "8e3444e1db7a6bd06b7f3683c3d82db77406357b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pestphp/pest/zipball/b7406938ac9e8d08cf96f031922b0502a8523268", - "reference": "b7406938ac9e8d08cf96f031922b0502a8523268", + "url": "https://api.github.com/repos/pestphp/pest/zipball/8e3444e1db7a6bd06b7f3683c3d82db77406357b", + "reference": "8e3444e1db7a6bd06b7f3683c3d82db77406357b", "shasum": "" }, "require": { - "brianium/paratest": "^7.12.0", + "brianium/paratest": "^7.14.0", "nunomaduro/collision": "^8.8.2", "nunomaduro/termwind": "^2.3.1", "pestphp/pest-plugin": "^4.0.0", @@ -10126,12 +10126,12 @@ "pestphp/pest-plugin-mutate": "^4.0.1", "pestphp/pest-plugin-profanity": "^4.1.0", "php": "^8.3.0", - "phpunit/phpunit": "^12.3.8", + "phpunit/phpunit": "^12.3.15", "symfony/process": "^7.3.3" }, "conflict": { "filp/whoops": "<2.18.3", - "phpunit/phpunit": ">12.3.8", + "phpunit/phpunit": ">12.3.15", "sebastian/exporter": "<7.0.0", "webmozart/assert": "<1.11.0" }, @@ -10205,7 +10205,7 @@ ], "support": { "issues": "https://github.com/pestphp/pest/issues", - "source": "https://github.com/pestphp/pest/tree/v4.1.0" + "source": "https://github.com/pestphp/pest/tree/v4.1.1" }, "funding": [ { @@ -10217,7 +10217,7 @@ "type": "github" } ], - "time": "2025-09-10T13:41:09+00:00" + "time": "2025-10-01T13:30:25+00:00" }, { "name": "pestphp/pest-plugin", @@ -11241,16 +11241,16 @@ }, { "name": "phpunit/phpunit", - "version": "12.3.8", + "version": "12.3.15", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "9d68c1b41fc21aac106c71cde4669fe7b99fca10" + "reference": "b035ee2cd8ecad4091885b61017ebb1d80eb0e57" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/9d68c1b41fc21aac106c71cde4669fe7b99fca10", - "reference": "9d68c1b41fc21aac106c71cde4669fe7b99fca10", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b035ee2cd8ecad4091885b61017ebb1d80eb0e57", + "reference": "b035ee2cd8ecad4091885b61017ebb1d80eb0e57", "shasum": "" }, "require": { @@ -11264,16 +11264,16 @@ "phar-io/manifest": "^2.0.4", "phar-io/version": "^3.2.1", "php": ">=8.3", - "phpunit/php-code-coverage": "^12.3.6", + "phpunit/php-code-coverage": "^12.4.0", "phpunit/php-file-iterator": "^6.0.0", "phpunit/php-invoker": "^6.0.0", "phpunit/php-text-template": "^5.0.0", "phpunit/php-timer": "^8.0.0", - "sebastian/cli-parser": "^4.0.0", + "sebastian/cli-parser": "^4.2.0", "sebastian/comparator": "^7.1.3", "sebastian/diff": "^7.0.0", "sebastian/environment": "^8.0.3", - "sebastian/exporter": "^7.0.0", + "sebastian/exporter": "^7.0.2", "sebastian/global-state": "^8.0.2", "sebastian/object-enumerator": "^7.0.0", "sebastian/type": "^6.0.3", @@ -11318,7 +11318,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/12.3.8" + "source": "https://github.com/sebastianbergmann/phpunit/tree/12.3.15" }, "funding": [ { @@ -11342,7 +11342,7 @@ "type": "tidelift" } ], - "time": "2025-09-03T06:25:17+00:00" + "time": "2025-09-28T12:10:54+00:00" }, { "name": "sebastian/cli-parser", diff --git a/database/seeders/PlansSeeder.php b/database/seeders/PlansSeeder.php index 7e50e5e..7fd196a 100644 --- a/database/seeders/PlansSeeder.php +++ b/database/seeders/PlansSeeder.php @@ -14,7 +14,7 @@ class PlansSeeder extends Seeder { $sql = "INSERT INTO `plans` (`id`, `name`, `payment`, `description`, `icon`, `preis`, `limit_user`, `limit_gutachter`, `created_at`, `updated_at`) VALUES - ('1', 'Basic', 'Per Gutachten', 'Zahlungen per Gutachten.', 'phosphor-airplane-thin', '75', '1', '1', NULL, '2025-09-30 15:53:33'), + ('1', 'Basic', 'Einzeln', 'Zahlung erfolgt per Gutachten.', 'phosphor-airplane-thin', '75', '1', '1', NULL, '2025-09-30 15:53:33'), ('2', 'Standard', 'Monatlich', 'Zahlung erfolgt monatlich, ohne Begrenzung der Gutachten.', 'phosphor-airplane-takeoff-thin', '150', '3', '3', NULL, '2025-09-30 15:53:42'), ('3', 'Premium', 'Jährlich', 'Zahlung erfolgt jährlich, ohne Begrenzung für Gutachten, Gutachter oder Auftraggeber.', 'phosphor-airplane-in-flight-thin', '1750', '10', '5', NULL, '2025-09-30 15:53:47'); "; diff --git a/lang/de/validation.php b/lang/de/validation.php new file mode 100644 index 0000000..4e344d3 --- /dev/null +++ b/lang/de/validation.php @@ -0,0 +1,107 @@ + 'The :attribute must be accepted.', + 'active_url' => 'The :attribute is not a valid URL.', + 'after' => 'The :attribute must be a date after :date.', + 'alpha' => 'The :attribute may only contain letters.', + 'alpha_dash' => 'The :attribute may only contain letters, numbers, and dashes.', + 'alpha_num' => 'The :attribute may only contain letters and numbers.', + 'array' => 'The :attribute must be an array.', + 'before' => 'The :attribute must be a date before :date.', + 'between' => [ + 'numeric' => 'The :attribute must be between :min and :max.', + 'file' => 'The :attribute must be between :min and :max kilobytes.', + 'string' => 'The :attribute must be between :min and :max characters.', + 'array' => 'The :attribute must have between :min and :max items.', + ], + 'boolean' => 'The :attribute field must be true or false.', + 'confirmed' => 'The :attribute confirmation does not match.', + 'date' => 'The :attribute is not a valid date.', + 'date_format' => 'The :attribute does not match the format :format.', + 'different' => 'The :attribute and :other must be different.', + 'digits' => 'The :attribute must be :digits digits.', + 'digits_between' => 'The :attribute must be between :min and :max digits.', + 'email' => 'The :attribute must be a valid email address.', + 'filled' => 'The :attribute field is required.', + 'exists' => 'The selected :attribute is invalid.', + 'image' => 'The :attribute must be an image.', + 'in' => 'The selected :attribute is invalid.', + 'integer' => 'The :attribute must be an integer.', + 'ip' => 'The :attribute must be a valid IP address.', + 'max' => [ + 'numeric' => 'The :attribute may not be greater than :max.', + 'file' => 'The :attribute may not be greater than :max kilobytes.', + 'string' => 'The :attribute may not be greater than :max characters.', + 'array' => 'The :attribute may not have more than :max items.', + ], + 'mimes' => 'The :attribute must be a file of type: :values.', + 'min' => [ + 'numeric' => 'The :attribute must be at least :min.', + 'file' => 'The :attribute must be at least :min kilobytes.', + 'string' => 'The :attribute must be at least :min characters.', + 'array' => 'The :attribute must have at least :min items.', + ], + 'not_in' => 'The selected :attribute is invalid.', + 'numeric' => 'The :attribute must be a number.', + 'regex' => 'The :attribute format is invalid.', + 'required' => 'Diese Feld ist erforderlich.', + 'required_if' => 'The :attribute field is required when :other is :value.', + 'required_with' => 'The :attribute field is required when :values is present.', + 'required_with_all' => 'The :attribute field is required when :values is present.', + 'required_without' => 'The :attribute field is required when :values is not present.', + 'required_without_all' => 'The :attribute field is required when none of :values are present.', + 'same' => 'The :attribute and :other must match.', + 'size' => [ + 'numeric' => 'The :attribute must be :size.', + 'file' => 'The :attribute must be :size kilobytes.', + 'string' => 'The :attribute must be :size characters.', + 'array' => 'The :attribute must contain :size items.', + ], + 'timezone' => 'The :attribute must be a valid zone.', + 'unique' => 'The :attribute has already been taken.', + 'url' => 'The :attribute format is invalid.', + + /* + |-------------------------------------------------------------------------- + | Custom Validation Language Lines + |-------------------------------------------------------------------------- + | + | Here you may specify custom validation messages for attributes using the + | convention "attribute.rule" to name the lines. This makes it quick to + | specify a specific custom language line for a given attribute rule. + | + */ + + 'custom' => [ + 'attribute-name' => [ + 'rule-name' => 'custom-message', + ], + ], + + /* + |-------------------------------------------------------------------------- + | Custom Validation Attributes + |-------------------------------------------------------------------------- + | + | The following language lines are used to swap attribute place-holders + | with something more reader friendly such as E-Mail Address instead + | of "email". This simply helps us make messages a little cleaner. + | + */ + + 'attributes' => [], + +];